Page 1 of 1

Re: Set global variable from file

Posted: Wed Dec 16, 2015 3:40 pm
by samyamkrishna
One of the ways would be to.

read only the field you need using a cut command in UNIX.
replace '\n' with a ','.
pass this as a parameter to the job or sequence.

Posted: Wed Dec 16, 2015 4:29 pm
by chulett
I wouldn't pass a list of "50 or 101" values as a parameter in a job, you can build a string and do it I just wouldn't recommend it. In your shoes I would load those values to a work table and then change your SQL to be more like:

Code: Select all

Select * from table where field in (select field from work_table);
That would work regardless of the number of rows in the input file.

Posted: Mon Dec 21, 2015 3:43 pm
by chulett
Can't? That's a pretty severe limitation if you can't build work tables. IMHO.

Posted: Mon Dec 21, 2015 3:44 pm
by samyamkrishna
You can read only the field you need using a cut command in UNIX.
replace '\n' with a ',' and write the sql into a .sql file.

in the DB stage use read SQL from file option.

Re: Set global variable from file

Posted: Mon Dec 21, 2015 10:16 pm
by naveenkumar.ssn
hi

I would suggest you to write all the required columns in a temp table and then use that temp table data to get your required search

OR

use the looping mechanism , read the content of file one by one and then view the records either at one go or read all the data .

Posted: Wed Jan 20, 2016 5:59 pm
by ray.wurlod
Get "them" to allow you to create and use temporary tables.