Page 1 of 1

dynamic sql in oci stage.

Posted: Mon Nov 19, 2007 3:33 pm
by kollurianu
Hi all ,

Is it possible in datastage to create a dynamic sql in oci stage .
Appreciate your inputs and help.

thanks to all

Posted: Mon Nov 19, 2007 3:58 pm
by chulett
Depends on your definition of 'dynamic'. What are you trying to accomplish?

Posted: Mon Nov 19, 2007 4:26 pm
by chulett
The closest you'll get to 'dynamic' (IMHO) is the Update Action of 'Load SQL from a file at run time'. Then the area where you would normally put your user-defined SQL holds the actual pathname of the file to load. Something to note, however, if you do that. While you can use job parameters for the filename itself, the actual SQL loaded from a file cannot contain any Job Parameters.

Your other option is to pass the SQL, or perhaps just a signficant portion of the WHERE clause, in as a Job Parameter and then bind that parameter into your generated SQL.

Posted: Mon Nov 19, 2007 8:17 pm
by rleishman
An inferior solution (but possible) is use a user-defined SQL that calls a stored procedure, which in turn generates dynamic SQL in PL/SQL.

Posted: Tue Nov 20, 2007 1:36 pm
by kollurianu
Thank you all for your inputs.,