While Running the below package which using collections i am getting below error
ERROR at line 1: ORA-06533: Subscript beyond count ORA-06512: at "WAT_USER.PKG_WAT_RULES_VALIDATION", line 289 ORA-06512: at line 2 CREATE OR REPLACE PACKAGE BODY PKG_WAT_RULES_VALIDATION_FA IS PROCEDURE PRO_WAT_RULES_VALIDATION_SP AS CURSOR CUR_WAT_SOURCE_DATA_VAL IS
I am trying to create a varray of strings using elements returned from a nested table, but getting ora-06533 error,I am using a script as below:
DECLARE time_start NUMBER; time_end NUMBER; TYPE text_nt IS TABLE OF cpw_account_info%ROWTYPE; [code]....
I am trying to fetch this data through a nested table and prepare a set of strings(api calls) thru varray..Execute the prepared varray thru execute immediate statement
I want to use superscript / subscript just like in word in rdf (oracle 8i / reports 6) for creating a footnote. for e.g. reserch1 . 1 should appear on top . is it possible to in reports to do that.
I need to take the distinct values from VARRAY.. I have wrote following simple example. But it does not work. how to get the distinct value from VARRAY.
declare type t is varray(10) of varchar2(10); t1 t; type r is table of varchar2(10) index by binary_integer; r1 r; begin t1 := t('A','B','A','B','A','B','C'); select distinct * into r1 from table(select * from t1); END;
type t is varray(50) of number; t1 t; cursor c1(t3 t) is select name from temp2 where id in(t3(1),t3(2)); name1 varchar2(20); begin t1 :=t(501,384,3242,106); [code]......
my question varray size is 50, while creating the cursor i have to pass the 50 values like t3(1),t3(2).....t3(50). I have tried to use t3.first..t3.last in IN condition but throwing some error, any other method/hints to pass the values dynamically to cursor IN condition.
i have a doubt in plsql table and varray.. is this two things data will write on disc or it will perform through ly a memory level? if its in memory level i need a document about that.
BANNER Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production PL/SQL Release 11.2.0.3.0 - Production CORE 11.2.0.3.0 Production TNS for HPUX: Version 11.2.0.3.0 - Production
[code]...
SELECT job_request_id, CAST (COLLECT (USER_ID) AS SYS.OdcinumberList) user_ids FROM mytable GROUP BY job_request_id;
ORA-22814: attribute or element value is larger than specified in type
I'm trying to optimize an application running heavy updates/inserts/deletes, by having it using bind variables instead of "string queries".
The columns to be updated can vary (possibly from one column to all columns of a table), thus I have made som logic to build the query accordingly. My problem is now that I cant get the EXECUTE below to handle the VARRAY passed in the USING clause, it fails with "PLS-00457: expressions have to be of SQL types"
Environment:
create table table_x (a varchar2(10),b varchar2(10),c varchar2(10),d varchar2(10));
insert into table_x values('a','b','c','d'); commit;
Code, simplified with static number of columns:
declare type v is varray(10) of varchar2(20); v_values v:=v('A','B','c'); myupdate varchar2(2000); begin myupdate:='update table_x set a=:a, b=:b where c=:c'; dbms_output.put_line(myupdate); execute immediate myupdate using v_values; end;
I've understood that I cannot send TABLE type variables by USING, but this should be an VARRAY.
PLS-00386: type mismatch found at 'RECORD_VARRAY' between FETCH cursor and INTO variables
while executing the below code.
PROCEDURE MAIN_BULK_COLLECT(P_STARTDATE IN TIMESTAMP DEFAULT NULL, P_ENDDATE IN TIMESTAMP DEFAULT NULL, P_ROW_COUNT IN NUMBER DEFAULT 1000, O_RECORD_VARRAY OUT NOCOPY SSAM_VARRAY_TYPE, P_ERROR OUT VARCHAR2) AS [code]....
I'm able to run the program successfully using FOR LOOP instead of BULK COLLECT but wish to run using bulk collect.
I am trying to build an array that contains known column names, 63 columns in all.The idea is to search backwards from 63 down to say 10 to find the first non-blank column.
Then using a loop with the known number of lines print from 1 to last non-blank column.The problem is that it only shows the column names and not the values of the columns.So I am getting 63 lines every time, instead of 20, 30, 40 or however how many fields actually have something.
Here is my declare to_num number; field_name varchar2(15); [code]....
I trying to write plsql anonymous block to return the name of all the employees who belongs to a specific department . I am writing below script for this and getting the error where as the same logic if i use only in a function instead of creating it within a procedure , i am not getting any error .
Script :
DECLARE TYPE EMPARRAY is VARRAY(20) OF VARCHAR2(30); FUNCTION getEmpArray (p_no IN NUMBER) RETURN EMPARRAY AS [code].......
Error report: ORA-06550: line 18, column 4: PLS-00103: Encountered the symbol "end-of-file"
when expecting one of the following:
begin function package pragma procedure form 06550. 00000 - "line %s, column %s: %s" *Cause: Usually a PL/SQL compilation error. *Action:
Is it Possible doing SQL LOAD into Varray table having two inner objects.
find the structure of the table and its types for your reference
CREATE OR REPLACE TYPE OB_TEST_INFO AS OBJECT ( AGE NUMBER ( 3 ), NAME VARCHAR2 ( 14 ) ); /
CREATE OR REPLACE TYPE OB_TEST_INFO_VARRAY AS VARRAY( 400 ) OF OB_TEST_INFO ; /
CREATE OR REPLACE TYPE OB_TEST_MAINTENANCE AS OBJECT ( BREAKOUT_TYPE NUMBER ( 1 ), EXISTING_STRIPS_FLAG NUMBER ( 1 ), OB_TEST_INFO OB_TEST_INFO_VARRAY ); /
I am using arrays on this procedure but would like to use a WHILE LOOP to fill the array. The first element uses a balance forward amount unlike the next 11 elements so I would think I have no other choice for the first element.
jde_account_balances is the table name that stores the amounts.
i have created one varray whose elements are of record type. Now how can i access those record type elements?
structure of table t1: select * from t1;
IDDESCRIPTION
1a 2b 3c
select * from t2;
ID1DESCRIPTION1
4aa 5bb 1cc
declare type r1 is record (id t1.id%type); type r2 is record (id1 t2.id1%type); type r3 is record (id1 r1, id2 r2); type var1 is varray(20) of r3; [code].......
I want to move the data in the VARRAY column BT_DETAIL to another table. I have create a staging table BT_STG which contains a surrogate key column and the columns from the VARRAY. I am creating this staging table at run time.
difference between count(1) and count(*). As i know count(*) will give number of rows irrespective of null and count(1) will not count the null.My Oracle version is 10 g.
SQL> select * from t1;
A B C ---------- -------------------- -------------------- 1 2 3 2 5
SQL> select rownum,a.* from t1 a;
ROWNUM A B C ---------- ---------- -------------------- -------------------- 1 1 2 3 2 2 3 5 4 [code]....
I'm using this code, and it performs fine, but I'm wondering if there is a more elegant way to do it--maybe with "ROLLBACK". Basically (as you can see) I need to get a normal count for each group but also for each group take a percentage of the total count (so all groups pct adds up to 100 (oh yeah, don't test for zero below, but just a test... )
select c.Event, c.code, count(1) as calls, total.total_count, count(1) / total.total_count * 100 as pct_of_total from table1 c
[Code]....
[Edit MC: add code tags, do it yourself next time]