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
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