Home > database >  Consult the Oracle, questions about two cursors
Consult the Oracle, questions about two cursors

Time:09-17

I mean, by a stored procedure with input parameters dynamically obtain different view name, such as view_xx; The cursor A role now is to view inside A view called view_11, then the cursor b is to view_11 extract data from them but the definition can't open the cursor to do, also can not separate the select? Could you tell me what's the solution

CodePudding user response:

The cursor can also write a dynamic query,

CodePudding user response:

The create or replace procedurce por1 (v_1 varchar)
Is
Declare
Cor_1 sys_refcursor;
V_sql varchar2 (2000);
Beging
V_sql='select * from' | | v_1.
The open cor_1 for v_sql
Loop
The fetch cor_i into...

CodePudding user response:

refer to the second floor to learning turn response:
create or replace procedurce por1 (v_1 varchar)
Is
Declare
Cor_1 sys_refcursor;
V_sql varchar2 (2000);
Beging
V_sql='select * from' | | v_1.
The open cor_1 for v_sql
Loop
The fetch cor_i into...

Thank you. I'll try reply (even more than ten words)
  • Related