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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is this possible?

Status
Not open for further replies.

Jalr2003

Technical User
May 15, 2003
26
0
0
US
Hi,

I am not sure this can be done, but I ask just in case.

As you know, when the ampersand sign is included in the sql statement, the user is prompted to enter the value of the variable when the query is run.

Select field
from table
where variable='&value'

What if I have a list of values instead of just one, and every time I need to run the query, the number of items in the list is different?

select field
from table
where variable in (
values seperated by commans

)

Is it possible to somehow write a script (preferably using oracle sql plus) in which one enters the number of items in the list first and then the individual values one by one?

something like this?

Enter the number of IDs: 5

enter value for ID 1: 234
enter value for ID 2: 222
enter value for ID 3: 555
Enter value for ID 4: 101
enter value for ID 5: 677

and then the query runs..

Is this possible?


Thanks,

Jalr2003
 
This question would be better asked in one of the Oracle forums, since (a) SQL*Plus is not ANSI SQL and (b) you would be asking a more highly concentrated population of Oracle users.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top