Home » RDBMS Server » Server Administration » Substitution Variable in Select Statement (HELP)
Substitution Variable in Select Statement (HELP) [message #369747] Tue, 03 October 2000 14:59 Go to next message
John Nelson
Messages: 1
Registered: October 2000
Junior Member
I am trying to use a substitution variable following the select statement. My need is to take from one to 30 requests from a website for redisplay.
I have tried this approach in a package...

Define v_web_in = 'Column1,Column2,Column3'

Cursor lc_need_rec IS
Select &&v_web_in
From mytable
Where condition='true'

where v_web_in is defined as the columns to be selected based upon checkbox choices from the web site.

Any suggestions out there ??
Re: Substitution Variable in Select Statement (HELP) [message #369748 is a reply to message #369747] Tue, 03 October 2000 15:11 Go to previous message
Christian Boulet
Messages: 9
Registered: April 2000
Junior Member
This sound like you will need dynamic SQL...

And depending on which version of Oracle you run, you have 2 different way of codig it. Starting Oracle 8i, you can use Native Dynamic SQL which is a lot easier that the old DBLS_SQL Package.

see for Native
http://technet.oracle.com/doc/oracle8i_816/appdev.816/a77069/10_dynam.htm#4376
See for DBMS_SQL
http://technet.oracle.com/doc/oracle8i_816/server.816/a76936/dbms_sql.htm#998100

Either way, that's the only way you are going to create a valid Sql Statement.

see for Native
http://technet.oracle.com/doc/oracle8i_816/appdev.816/a77069/10_dynam.htm#4376
See for DBMS_SQL
http://technet.oracle.com/doc/oracle8i_816/server.816/a76936/dbms_sql.htm#998100

Good luck!

Christian
Previous Topic: Change format of date in SQL View
Next Topic: date & time
Goto Forum:
  


Current Time: Fri Mar 29 01:23:48 CDT 2024