oracle11g

Are nested parentheses in the FROM clause valid Oracle SQL syntax?

こ雲淡風輕ζ 提交于 2021-02-07 14:39:29
问题 Does this query use correct Oracle syntax? select * from ( ( ( dual a) ) ) where a.dummy = 'X'; It works in 11g and 12c but is it truly valid syntax? Or is this is just a compiler "mistake" that might be fixed in the future, causing the code the fail? I doubt this is the correct syntax for the following reasons: It doesn't seem to do anything other than add extra parentheses. Expressions like ((1+2)*3) can obviously benefit from nested parentheses but I don't see how they would ever help the

How to get column name for which PL/SQL object population is failing

天大地大妈咪最大 提交于 2021-02-07 09:15:19
问题 I have PL/SQL table-type and procedure as below. It is just part of code. While populating PL/SQL table type variable I am getting exception. CREATE OR REPLACE TYPE OBJ_EMPLOYEE AS OBJECT ( EMPID NUMBER(12) , EMPLOYEENAME VARCHAR2(100) , /* more attributes */ STATUS VARCHAR2(20) , UPDTDATE DATE , ); CREATE OR REPLACE TYPE TAB_EMPLOYEE IS TABLE OF OBJ_EMPLOYEE; CREATE OR REPLACE PROCEDURE sp_getEmpDetails ( p_ErrorCode_o OUT VARCHAR2, p_ErrorMsg_o OUT VARCHAR2 ) IS TEMP_EMPLOYEE TAB_EMPLOYEE :

How to get column name for which PL/SQL object population is failing

巧了我就是萌 提交于 2021-02-07 09:14:39
问题 I have PL/SQL table-type and procedure as below. It is just part of code. While populating PL/SQL table type variable I am getting exception. CREATE OR REPLACE TYPE OBJ_EMPLOYEE AS OBJECT ( EMPID NUMBER(12) , EMPLOYEENAME VARCHAR2(100) , /* more attributes */ STATUS VARCHAR2(20) , UPDTDATE DATE , ); CREATE OR REPLACE TYPE TAB_EMPLOYEE IS TABLE OF OBJ_EMPLOYEE; CREATE OR REPLACE PROCEDURE sp_getEmpDetails ( p_ErrorCode_o OUT VARCHAR2, p_ErrorMsg_o OUT VARCHAR2 ) IS TEMP_EMPLOYEE TAB_EMPLOYEE :

how to get names of partition in oracle while i input a date

本小妞迷上赌 提交于 2021-02-07 03:22:27
问题 I have a table with many partitions range. I need to get the name of all partition when I give a date. For eg: if I input date 20/09/2014, it should list all partitions before that given date. create or replace function get_part_name(p_date in date) return varchar2 is d date; retp varchar2(30); mind date:=to_date('4444-01-01','yyyy-mm-dd'); str varchar2(32000); cursor c is select high_value, partition_name p from user_tab_partitions where table_name='TEST'; begin for r in c loop str := r.high

how to get names of partition in oracle while i input a date

£可爱£侵袭症+ 提交于 2021-02-07 03:20:28
问题 I have a table with many partitions range. I need to get the name of all partition when I give a date. For eg: if I input date 20/09/2014, it should list all partitions before that given date. create or replace function get_part_name(p_date in date) return varchar2 is d date; retp varchar2(30); mind date:=to_date('4444-01-01','yyyy-mm-dd'); str varchar2(32000); cursor c is select high_value, partition_name p from user_tab_partitions where table_name='TEST'; begin for r in c loop str := r.high

Support for CHECKSUM in Oracle 11g

天大地大妈咪最大 提交于 2021-02-05 08:40:40
问题 I have the following in Postgres 9.2.4: postgres=# SELECT CHECKSUM(O_ORDERKEY) FROM tpch.orders; checksum -------------------- 322119959934139382 (1 row) Time: 41437.050 ms I have an instance of Oracle 11g database, with the same TPCH data, which I want to check consistency with the Postgres instance by comparing table checksums. From this link https://docs.oracle.com/en/database/oracle/oracle-database/20/sqlrf/checksum.html#GUID-3F55C5DF-F23A-4B2F-BC6F-E03B34B78BA8 I found out that CHECKSUM

Oracle Database change notification

时光怂恿深爱的人放手 提交于 2021-02-04 21:54:26
问题 I am new to DCN, can I use it to detect updates on a column in my table along with inserts in that table ? I am referring to this 回答1: Yes, you can - Change Notifications made for that. You need to register СN listener with query to watch (it can a whole table select * from your_table or part of it select column1 from your_table where column2='xxx' ) and callback function . You should understand that it is async mechanism changes will not detect immediately, but after some time. Your

Number format issue in Oracle

跟風遠走 提交于 2021-01-29 18:21:59
问题 So i have created a test table having a number column which is of the data type Number(11,8) . Now when i am trying to insert the value 13332 in the table it is throwing an oracle error saying: ORA-01438: value larger than specified precision allowed for this column I am not sure why. The same works when i am inserting into a column with data type Number(12,6) INSERT INTO MY_TABLE(COLUMN_1) values('13332'); 回答1: The reason is - out of 11 digits you have specified 8 digits after decimal places

Oracle SQL Dynamic Query non UTF-8 Characters

做~自己de王妃 提交于 2021-01-29 18:16:09
问题 I am trying to write a query that will provide all non UTF-8 encoded characters in a table, that is not specific to a column name. I am doing so by comparing the length of a column not equal to the byte length. %1 is the table name I want to check entered in a parameter. I am joining to user_tab_columns to get the COLUMN_NAME. I then want to take the COLUMN_NAME results and filter down to only show rows that have bad UTF-8 data (where length of a column is not equal to the byte length). Below

implicit inner joins - are they equal?

橙三吉。 提交于 2021-01-29 18:00:20
问题 In my opinion these two SELECTs are exactly equal (but I want to rewrite the first for the second to help the optimizer in my case) - whatever data sits in tables a,b,c,d both SELECTs will produce exactly the same results. Do you agree? Thanks! create table a (id number); create table b (id number); create table c (id number); create table d (id number); --Q1 select * from a,b,c,d where a.id = b.id and a.id = c.id and a.id = d.id; --Q2 select * from a,b,c,d where a.id = b.id and a.id = c.id