oracle11g

Generate the dates in between Start and End Dates

。_饼干妹妹 提交于 2020-01-02 06:10:39
问题 I need to generate all dates in between two given dates. Here is the problem statement: Input: START_DATE END_DATE ---------- ---------- 01-FEB-16 03-FEB-16 01-FEB-16 04-FEB-16 01-FEB-16 05-FEB-16 01-FEB-16 03-FEB-16 11-FEB-16 14-FEB-16 Output (All dates between start date and end dates): BETWEEN_START_AND_END ---------------------- 01-FEB-16 02-FEB-16 03-FEB-16 04-FEB-16 05-FEB-16 11-FEB-16 12-FEB-16 13-FEB-16 14-FEB-16 回答1: Query: with y(start_date, end_date, m) as ( select start_date, end

Generate the dates in between Start and End Dates

半城伤御伤魂 提交于 2020-01-02 06:09:55
问题 I need to generate all dates in between two given dates. Here is the problem statement: Input: START_DATE END_DATE ---------- ---------- 01-FEB-16 03-FEB-16 01-FEB-16 04-FEB-16 01-FEB-16 05-FEB-16 01-FEB-16 03-FEB-16 11-FEB-16 14-FEB-16 Output (All dates between start date and end dates): BETWEEN_START_AND_END ---------------------- 01-FEB-16 02-FEB-16 03-FEB-16 04-FEB-16 05-FEB-16 11-FEB-16 12-FEB-16 13-FEB-16 14-FEB-16 回答1: Query: with y(start_date, end_date, m) as ( select start_date, end

Why am I getting “format error: Property is 'v$session.program'” connecting to Oracle?

时间秒杀一切 提交于 2020-01-02 05:17:05
问题 I'm connecting to an Oracle 11g database from a Java application. I'm getting the following exception: Caused by: java.sql.SQLException: Connection property: format error: Property is 'v$session.program' and value is '<My Maven application's name>' at oracle.jdbc.driver.T4CConnection.validateConnectionProperties(T4CConnection.java:4540) at oracle.jdbc.driver.PhysicalConnection.readConnectionProperties(PhysicalConnection.java:2345) at oracle.jdbc.driver.PhysicalConnection.<init>

Escaping special characters in SQL

天大地大妈咪最大 提交于 2020-01-02 03:14:26
问题 Is there an easy way in Oracle to escape special characters in a SQL statement? (i.e. %, &, ') I saw this link in regard to manually escaping characters, but I thought Oracle may have provided an easier way to do so. Note: I'm generating dynamic SQL select statements through an ORM. 回答1: If using bind variables and ORM, embedded single quotes and ampersands should be handed automatically; those are special characters in SQL*Plus or SQL*Developer. To use LIKE where looking for the literal

ORA-39122: Unprivileged users may not perform REMAP_SCHEMA remappings

半城伤御伤魂 提交于 2020-01-02 02:32:31
问题 When i'm trying to run impdp command in sqlplus , i got below error. ORA-31631: privileges are required ORA-39122: Unprivileged users may not perform REMAP_SCHEMA remappings. I have granted IMPORT FULL DATABASE privileged to schema which i'm trying to import. but i'm getting above error. how could i solve this ? 回答1: more than likely, you granted: grant import full database to YOURUSER; instead grant: grant imp_full_database to YOURUSER; 回答2: grant imp_full_database to YOURUSER; will solve

How to convert VARCHAR2 to BLOB inside Oracle 11g PL/SQL after ORA-06502

蓝咒 提交于 2020-01-02 02:18:54
问题 I have a function, that calculates hash value of big string! First of all I wrote a cursor T1_CUT, which can include variable count of SELECT statements, something like: SELECT T1.COL1||T1.COL2||...||T1.COLn FROM T1 WHERE id=documentid SELECT T2.COL1||T2.COL2||...||T2.COLn FROM T2 WHERE id=documentid ... SELECT Tn.COL1||Tn.COL2||...||Tn.COLn FROM Tn WHERE id=documentid Each SELECT can contain one or more rows. So, I concat ALL values in rows in each SELECT and ALL SELECTs values in one big

Oracle PIVOT, twice?

倖福魔咒の 提交于 2020-01-01 18:59:44
问题 I have been trying to move away from using DECODE to pivot rows in Oracle 11g, where there is a handy PIVOT function. But I may have found a limitation: I'm trying to return 2 columns for each value in the base table. Something like: SELECT somethingId, splitId1, splitName1, splitId2, splitName2 FROM (SELECT somethingId, splitId FROM SOMETHING JOIN SPLIT ON ... ) PIVOT ( MAX(splitId) FOR displayOrder IN (1 AS splitId1, 2 AS splitId2), MAX(splitName) FOR displayOrder IN (1 AS splitName1, 2 as

Network access denied by access control list (ACL) in Oracle Database 11g

人盡茶涼 提交于 2020-01-01 18:55:11
问题 Recently we have switched from Oracle 10g to 11g, and only now I noticed that my mailing function does not work, I now get an error: ORA-24247: network access denied by access control list (ACL) So I did a bit of googling and was able to figure out that a new feature in Oracle 11g is now restricting users from using certain packages including utl_smtp. Because I am looking for a quick solution I did not read Oracle documentation, but instead I went looking for easier solutions and came across

Oracle built-in functions metadata

烈酒焚心 提交于 2020-01-01 17:20:35
问题 Is there a way to get metadata for the Oracle built-in aggeregate and other functions such as AVG, STDDEV, SQRT, etc.? I need to know object id and arguments meta. In the SYS.ALL_OBJECTS view I couldn't find anything useful. I also tried to search in SYS.ALL_ARGUMENTS view by object_name. Is there views or tables with built-in functions with data similar to SYS.ALL_OBJECTS and SYS.ALL_ARGUMENTS ? 回答1: You have tagged Oracle 10g, but from what I can find, you'll need Oracle 11g r1 to find out

Oracle built-in functions metadata

邮差的信 提交于 2020-01-01 17:20:12
问题 Is there a way to get metadata for the Oracle built-in aggeregate and other functions such as AVG, STDDEV, SQRT, etc.? I need to know object id and arguments meta. In the SYS.ALL_OBJECTS view I couldn't find anything useful. I also tried to search in SYS.ALL_ARGUMENTS view by object_name. Is there views or tables with built-in functions with data similar to SYS.ALL_OBJECTS and SYS.ALL_ARGUMENTS ? 回答1: You have tagged Oracle 10g, but from what I can find, you'll need Oracle 11g r1 to find out