Hi All,
I am writing a script which should have multiple parameters defined in the script itself and it should not be allowed while doing a join . When i give single value query get executed but when i give multiple values seperated by commas it throws error 'invalid multiple arguments' .
Table :
create table tab1 (col1 number ,col2 number);
create table tab2 (col1 number , col3 number );
values :
insert into tab1 values (1,11) ;
insert into tab1 values (2,21) ;
insert into tab1 values (3,31);
insert into tab2 values (1,11);
insert into tab2 values (2,21) ;
insert into tab2 values (3,31) ;
My script :
SET echo OFF ver OFF pages 0 trimspool ON feed OFF und OFF;
DEFINE invalid_value = '2,3';
SET term OFF;
SET VERIFY OFF;
SET linesize 30000
SET WRAP OFF
prompt "col1","col2"
select
'"'
||"Col1"
||'","'
||"Col2"
from
(
select a.* from tab1 a , tab2 b where a.col1 = b.col1
and a.col1 != &invalid_value ) ;
spool off;
exit ;
/
When i execute the Query with single value in DEFINED I am able to get output but if i execute with multiple values say '2,3' then i am getting an error . Is there any way to to pass multiple values in single DEFINE statement .
Regards,
Uday