Page 1 of 1

How to get the SQL sent to DataBase in the Job Log ?

Posted: Thu Nov 03, 2005 10:58 am
by kaps
Hi

I use ODBC Stage to get the data from DB2. I would like to see the SQL which is sent to the database from DataStage in my job logfile. How do I do that ?

Also, how do we know what SQL has got executed in the database.
I know we can look at view SQL tab to see the SQL which is been sent to database. but how do we know if thats what is getting executed exactly in the database. Otherwords how do we know if the database is not dropping something or converting something in the Database when the query is executed...

Thanks

Posted: Thu Nov 03, 2005 2:32 pm
by ray.wurlod
1. On the Tracing tab select all options except "report row data".

2. Have your DBA monitor what's executed.

DataStage uses "prepared SQL".

Posted: Fri Nov 04, 2005 10:52 am
by kaps
I did select all options in tracing tab except REPORT ROW DATA and still it does not show me the SQL sent to DataBase in the Job Log.

Am I Missing something here ?

Thanks

Posted: Fri Nov 04, 2005 3:29 pm
by ray.wurlod
Yes, my bad. The trace goes into a trace file; a file in the &PH& directory in your project. The file name ends in "Trace".

Posted: Fri Nov 04, 2005 4:03 pm
by kaps
So there is no way we can see the SQL in the job log in Director ?

Thanks

Posted: Sat Nov 05, 2005 2:52 am
by ray.wurlod
The job log logs what the job does. The Link Report entries will normally show the SQL that DataStage sends. As far as I am aware DataStage has no mechanism to capture any "translation" that might be done by an ODBC driver, database client software or database server.