Home » Developer & Programmer » Forms » Using "macro substitution" in PL/SQL for D2000 (Oracle Developer 2000)
Using "macro substitution" in PL/SQL for D2000 [message #315643] Tue, 22 April 2008 05:10 Go to next message
irvs79
Messages: 7
Registered: April 2008
Junior Member
Hello,

I am currently learning D2000. I just want to know if PL/SQL is capable of "macro substituion" wherein a command/literal can be manipulated dynamically during runtime? For example, an SQL statement for a CURSOR that can have various "WHERE" clause depending on satisfied conditions.

[Updated on: Tue, 22 April 2008 05:12]

Report message to a moderator

Re: Using "macro substitution" in PL/SQL for D2000 [message #315665 is a reply to message #315643] Tue, 22 April 2008 06:15 Go to previous messageGo to next message
Michel Cadot
Messages: 68732
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Yes, use dynamic SQL.

Regards
Michel
Re: Using "macro substitution" in PL/SQL for D2000 [message #315917 is a reply to message #315665] Wed, 23 April 2008 04:10 Go to previous messageGo to next message
irvs79
Messages: 7
Registered: April 2008
Junior Member
Hi Michel,

Dynamic SQL was great! However, when I tried using "TYPE .. IS REF CURSOR" in declaring my cursor, the application is producing an error at runtime. It says that the identifier must be declared. The code was something like this:

declare
TYPE EmpCurTyp IS REF CURSOR;
curSearch EmpCurTyp;

The message says "curSearch must be declared". Also, the "OPEN curSearch FOR cCurStr USING P_TCU_ID, P_TCU_NAME;" line is producing an error. It says that the feature is not available in Client side applications. Seems like this approach is for Database Stored Procedures only.

The problem is, I want to use Dynamic SQL in processing form details. Is this possible?

Your help is greatly appreciated.

Thanks,

Irvin
Re: Using "macro substitution" in PL/SQL for D2000 [message #316913 is a reply to message #315917] Mon, 28 April 2008 19:41 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
No. As you said, it is only available in the database. You will have to pass the components between a form and the database as separate parameters.

David
Previous Topic: icons on buttons
Next Topic: Form Waiting on Client Input with client frozen
Goto Forum:
  


Current Time: Mon Feb 03 04:50:08 CST 2025