Java, SpringBoot, React, Angular, Oracle, PL/SQL, Ellucian Banner, Puppet, Docker, Terraform technical notes
Thursday, February 1, 2018
Store Procedure PLSQL returns Cursor in Loop to Java
create type test_obj AS object
(
P_Program VARCHAR2(400)
);
CREATE TYPE test_nt AS TABLE OF test_obj;
Procedure Proc1 (P_Cursor Out SYS_REFCURSOR)
AS
Cursor C1 Is
Select * from .......;
Cursor C2 (P_Program_In In Varchar2) Is
Select * from where program = P_Program_In ;
P_Program VARCHAR2(400);
v_prog_nt test_nt;
i integer := 0;
Begin
--SELECT test_obj(P_Program ) BULK COLLECT INTO v_prog_nt FROM DUAL;
v_prog_nt := test_nt();
For Ds In C1
Loop
For Rs In C2(Ds.Program)
Loop
v_prog_nt.extend;
i:= i+1;
P_Program := Rs.Program;
v_prog_nt(i) := test_obj(P_Program );
--dbms_output.put_line(i);
dbms_output.put_line(v_prog_nt(i).P_Program);
End Loop;
End Loop;
Open P_Cursor
For
Select P_Program from table(v_prog_nt);
End;
Subscribe to:
Post Comments (Atom)
AWS how to delete VPC when it has error with Network interface , Gateway decencies
how to delete VPC when it has error with Network interface , Gateway decencies in AWS 1. Check if it is running on EC2 instance then Sto...
-
ORA-29273: HTTP request failed ORA-06512: at "SYS.UTL_HTTP", line 1525 ORA-29261: bad argument ORA-29273: HTTP request failed ...
-
Banner 9 Admin: Invalid Object Name fix do steps: A record in GUBOBJS with a UI Version of D. • Records in GURAOBJ to define the defau...
-
chown root $ORACLE_HOME/bin/extjob chmod 4750 $ORACLE_HOME/bin/extjob chown root $ORACLE_HOME/rdbms/admin/externaljob.ora chmod 640 $ORA...
No comments:
Post a Comment