03-13-2015 09:51 AM
I am trying the below but it is not working. I am not getting any data. please suggest.
infile "$inbound_path/program_child_id.txt" dlm=",";
input id :$11. @@;
select * into :child separated by ','
create table x as select * from connection to oracle
(select a.*, b.* from table1 a,
where a.program_id in (&program)
and trim(a.program_child_id) in ('&child')
and a.program_id = b.program_id
and a.program_child_id = b.program_child_id
03-13-2015 10:14 AM
Macro variables need to be enclosed within double quotes. So your statement;
select * into :child separated by '","'
Note the single then double quotes and doubel then single. Then in your program:
and trim(a.program_child_id) in ("&child")
Thus it resolves to: in ("abc","def","efg").
Same for program:
where a.program_id in ("&program")
So your code needs to resolve to SQL compliant results.