Date as a parameter

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
vsi
Premium Member
Premium Member
Posts: 507
Joined: Wed Mar 15, 2006 1:44 pm

Date as a parameter

Post by vsi »

Hi,

Can we use date as a parameter to the SQL queries which we embed in Database Stages to extract data??

Thank You
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Yes, you can. :)
Kris

Where's the "Any" key?-Homer Simpson
nick.bond
Charter Member
Charter Member
Posts: 230
Joined: Thu Jan 15, 2004 12:00 pm
Location: London

Post by nick.bond »

Yes - just remember that the parameter is inserted into the SQL statement exactly as it is written and no quotes are put in there for you, so if the parameter contains a string value you will need single quotes around it.

e.g.

select * from my_table where my_varchar_col = '#pMY_PARM#'
Regards,

Nick.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Also keep in mind that you should send a date part and a time part seperately, or timestamp with only integers in it. Because unix doesn like space in the param file and in a timestamp you will have a space between a date and time part.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply