Page 1 of 1

Using Before SQL

Posted: Wed Aug 26, 2009 1:19 am
by reddy82
Hi ,
I have a job which i need to set the some parameters in the BEFORE SQL tab of DB2 API stage

==> We have user defined datatypes for all the tables and while querying the these statements with our own logins to database other than our instance DB2INST1 we re having issues.

i am trying to set the following variables in before sql

SET PATH=DB2INST1;;
SET SCHEMA=DB2INST1;;

and my SQL statement is :

select * from table where varchar(field name)='????'

Before the above select statemnet executes i want to the SET variables ( mentioned above) to be executed in datastage .

I have unchecked the NON FATAL check box;

Please provide your options / suggestions so that this works

Regards,
Reddy

Posted: Wed Aug 26, 2009 5:31 am
by chulett
If you're trying to set enviroment variables, that needs to happen before you start the job. 'Before SQL' needs to be valid sql / session statements... are these? :?