![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi. *I'm trying to use a varchar as the first part of a for loop but can't find a way to make it work. * * * listCursor * * varchar2(100); * * if x is not NULL then * * * *listCursor := 'for x_rec in xC(parm1, parm2) loop'; * * else * * * *listCursor := 'for y_rec in yC(parm1, parm2) loop '; * * end if; * * print listCursor **** not sure of syntax here or if this is even possible. * * * * .... * * * * .... * * end loop; Any suggestions? many thanks, tony |
#3
| |||
| |||
|
|
On Oct 19, 9:31*am, jimmy <bigtoeh... (AT) hotmail (DOT) com> wrote: Hi. *I'm trying to use a varchar as the first part of a for loop but can't find a way to make it work. * * * listCursor * * varchar2(100); * * if x is not NULL then * * * *listCursor := 'for x_rec in xC(parm1, parm2) loop'; * * else * * * *listCursor := 'for y_rec in yC(parm1, parm2) loop '; * * end if; * * print listCursor **** not sure of syntax here or if this is even possible. * * * * .... * * * * .... * * end loop; Any suggestions? many thanks, tony The dbms_output package can be used to write information to the screen for debugging purposes. See your PL/SQL Packages and Types manual for details. Example: dbms_output.put_line('sting ='||plsql_variable); The use of 'setserveroutput on' is required prior to use to see the output. |
|
I am just going to assume you are writing some kind of code generator and not worry about how you intend to execute your cursor. |
| HTH -- Mark D Powell -- |
![]() |
| Thread Tools | |
| Display Modes | |
| |