- create or replace type paramlist as array(4) of varchar2(20);
- create or replace procedure firstproc(params in paramlist) as
- TYPE MY_CURSOR IS REF CURSOR;
- cur MY_CURSOR ;
- pd pdata%rowtype;
- rsize number(10);
- begin
- dbms_output.put_line('=====>>>>>1'||params(4));
- select count(*) into rsize from pdata where ronum=params(4) ;
- open cur for select * from pdata where ronum=params(4) ;
- if cur%isopen then
- dbms_output.put_line('=====>>>>>open'||rsize);
- end if;
- if cur%isopen then
- dbms_output.put_line('=====>>>>>20 '||rsize);
- fetch cur into pd;
- insert into testa(aid,aname,idnumber,address) values(seq_testa.nextval,params(1),params(2),params(3));
- insert into testb(bid,addattr,blevel,aquipment,attack,bmaster,aid,ronum)values(seq_testb.nextval,pd.addattr,pd.blevel,pd.aquipment,pd.attack,pd.bmaster,10000,pd.ronum);
- dbms_output.put_line('insert into a,b');
- dbms_output.put_line('=====>>>>>2');
- commit;
- update testa set bid=222222222222222;
- update testb set aid=(select aid from testa where idnumber=params(2));
- dbms_output.put_line('update from a,b');
- dbms_output.put_line('=====>>>>>3');
- commit;
- end if;
- close cur;
- exception when others then
- rollback;
- end;