Page 1 of 1

Can I use a job parameter in Datastage SQL

Posted: Tue Nov 23, 2004 9:48 am
by dsfan2004
Good morning everyone,

Can I use a job parameter in Datastage SQL?

for example, if I have a job parameter named process_date, and I want to get all the data from a table TBL_Transaction before process_date, can I write a sql like this

select * from TBL_Transaction where Last_Update_Date<= #process_date#

Posted: Tue Nov 23, 2004 9:57 am
by KeithM
Yes, you can use parameters in your SQL. The only thing I think you might need are ticks around your date. We use SQL Server and the dates are required to be enclosed in ticks.

Code: Select all

select * from TBL_Transaction where Last_Update_Date<= '#process_date#'

Posted: Tue Nov 23, 2004 10:29 am
by shawn_ramsey
Speaking from experience, I would also make sure you do an explicit conversion of the data type from character to date. In the SQL Server example using CONVERT or with Oracle the TO_DATE.