Can I use a job parameter in Datastage SQL

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
dsfan2004
Participant
Posts: 10
Joined: Tue Feb 17, 2004 5:03 pm

Can I use a job parameter in Datastage SQL

Post 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#
KeithM
Participant
Posts: 61
Joined: Thu Apr 22, 2004 11:34 am
Contact:

Post 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#'
Keith
shawn_ramsey
Participant
Posts: 145
Joined: Fri May 02, 2003 9:59 am
Location: Seattle, Washington. USA

Post 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.
Shawn Ramsey

"It is a mistake to think you can solve any major problems just with potatoes."
-- Douglas Adams
Post Reply