|
|
Question : varray in stored procedures
|
|
I have a comma delimited string of numbers in a varchar2 that i would like to place into an array. I can get the numbers into a varray, but when i try to use the array that I created, I get an error. Can anyone point me into the right direction? Code is below:
A INTEGER; FDBK INTEGER; VSQL VARCHAR2(500); TYPE V_NUMARRAY IS VARRAY(300) OF NUMBER;
VSQL:='V_NUMARRAY_REC V_NUMARRAY:=V_NUMARRAY(' || ITEMLIST || ')'; A:=SYS.DBMS_SQL.OPEN_CURSOR; SYS.DBMS_SQL.PARSE(A,VSQL,DBMS_SQL.NATIVE); FDBK:=SYS.DBMS_SQL.EXECUTE(A); SYS.DBMS_SQL.CLOSE_CURSOR(A); FOR V_LOOP_NUM IN 1..V_NUMARRAY_REC.COUNT LOOP DELETE NOTE WHERE DOC_NBR = DOCNBR AND ITEM_NUMBER = V_NUMARRAY_REC(V_LOOP_NUM); UPDATE NOTE SET ITEM_NUMBER = ITEM_NUMBER - 1 WHERE DOC_NBR = DOCNBR AND ITEM_NUMBER > V_NUMARRAY_REC(V_LOOP_NUM); DELETE DRAWTEST WHERE DOC_NBR = DOCNBR AND ITEM_NUMBER = V_NUMARRAY_REC(V_LOOP_NUM); UPDATE DRAWTEST SET ITEM_NUMBER = ITEM_NUMBER - 1 WHERE DOC_NBR = DOCNBR AND ITEM_NUBMER > V_NUMARRAY_REC(V_LOOP_NUM); END LOOP;
Thanks in advance, Mike
|
Answer : varray in stored procedures
|
|
MikeABB, Could you write me your Store procedure that fails ?, meanwhile....
I want to recommend you to use SQL/PL Developer, that's a very good Oracle develop app.
You are able to download it at:
http://www.allroundautomations.nl/plsqldev.html
It's really good and cheap.
Good luck, SIDCAP :-) Bye, SIDCAP
|
|
|
|
|