plsql

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 :

Fastest way to compute for hash of a whole table [duplicate]

夙愿已清 提交于 2021-02-07 06:20:08
问题 This question already has an answer here : Oracle get checksum value for a data chunk defined by a select clause (1 answer) Closed 2 years ago . We need to be able to compute table hashes for an external environment and compare it to pre-computed hash from an internal environment. The use of this is to ensure that data in the external environment is not tampered by a "rogue" database administrator. Users insist this feature . Currently, we do this by computing the individual hashes of each

Oracle: Fastest Way in PL/SQL to See if Value Exists: List, VARRAY, or Temp Table

主宰稳场 提交于 2021-02-07 04:05:49
问题 UPDATE View the edits if you care to see the long original question. This is the clearer short version of the question... I need to see if GroupA (not always GroupA , this changes each loop iteration) exists in a [list,varray,temp table, whatever] of 200 or so groups. How I store those 200 groups is totally in my control. But I want to store them in a construct that lends itself to the FASTEST "existence" checking because I will have to check this list MANY times within a loop against

Oracle database dependencies in PL/SQL

怎甘沉沦 提交于 2021-02-07 04:00:56
问题 I need to find dependencies between functions/procedures(defined inside package bodies) and tables which they use. I've tried all_dependencies but it works only on the package-level, not the inner function/procedure-level. Is there any possibilty to find this dependencies using e.g. all_source ? Thanks in advance for your help. 回答1: It is not possible to find the dependencies between procedures (in a package) and tables. There are several tools to examine dependencies. As you've already

Oracle database dependencies in PL/SQL

你离开我真会死。 提交于 2021-02-07 04:00:06
问题 I need to find dependencies between functions/procedures(defined inside package bodies) and tables which they use. I've tried all_dependencies but it works only on the package-level, not the inner function/procedure-level. Is there any possibilty to find this dependencies using e.g. all_source ? Thanks in advance for your help. 回答1: It is not possible to find the dependencies between procedures (in a package) and tables. There are several tools to examine dependencies. As you've already

Oracle database dependencies in PL/SQL

醉酒当歌 提交于 2021-02-07 03:59:41
问题 I need to find dependencies between functions/procedures(defined inside package bodies) and tables which they use. I've tried all_dependencies but it works only on the package-level, not the inner function/procedure-level. Is there any possibilty to find this dependencies using e.g. all_source ? Thanks in advance for your help. 回答1: It is not possible to find the dependencies between procedures (in a package) and tables. There are several tools to examine dependencies. As you've already

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

SQL Query to return N rows from dual

五迷三道 提交于 2021-02-06 15:24:06
问题 I want to write a SQL query which accepts a bind variable (say :NUM) and its output consists of one column & :NUM number of rows, each row having its row number. i.e. if we pass :NUM as 7, the output should be: VAL ==== 1 2 3 4 5 6 7 There shouldn't be any actual DB tables in query and no PL/SQL code should be used. i.e. only dual should be used in the query Is there any way to achieve this? 回答1: You could use: WHERE ROWNUM <= :NUM ...but the table has to contain row equal or greater to the