how to solve this Oracle Cursor.

Posted by Jayakumars under ASP.NET AJAX on 9/17/2012 | Points: 10 | Views : 885 | Status : [Member] [MVP] | Replies : 0
hi

I am getting the table name list that have more than rows now i need to pass the
table name dynamically to the another select query how to solve this issue
with cursor

this is my Query
===================
create or replace Procedure SP_cfor(P_ClientId varchar2, P_Curss out SYS_REFCURSOR )
IS P_CliId varchar(50) := P_ClientId ;
v_ccode courses.ccode%type;
cursor cursor_one is

/*below the select query which is used to get the tablename more than 5records. how to pass this table name to the second query.*/

SELECT CONCAT( 'dyn_',FIELDTABLE)as FIELDTABLE from TBL_SETTABLEINDEX order by FIELDTABLEINDEX asc;
begin
open cursor_one;
loop
fetch cursor_one into v_ccode;
'select * from '|| v_ccode.FIELDTABLE ||' where CLIENTID='|| P_CliId ||'';

end loop;
end SP_cfor;

Mark as Answer if its helpful to you


Responses

(No response found.)

Login to post response