Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i pass in parameters into th

Status
Not open for further replies.

raji96

Programmer
Aug 7, 2001
64
US
how do i pass in parameters into the select statement as select fields?

for eg:
select &fields1&,&fields2& from table.

The &fields1&,&fields2 will be variables.


thanks.
 

If I get you right, let's set the following procedure as example:

create or replace procedure (p_code number, p_name)

begin

SELECT p_code, p_name, column1, column2
INTO
FROM table...

end;
/

Is this what you mean?
 
You do may pass those variables to sql*plus as substituting variables if you know at least the number of selected columns. In pl/sql you may build your select statement and execute it via dynamic sql. You may use dbms_sql package, it will work on Oracle 7+. If you're on 8.1.6+ try to open a cursor for your string (varchar2) statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top