passing date as parameter through sequence

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
mystuff
Premium Member
Premium Member
Posts: 200
Joined: Wed Apr 11, 2007 2:06 pm

passing date as parameter through sequence

Post by mystuff »

I found few topics similar to this, but this one is somewhat different.

I have a sequence_TOP calling another sequence_LOW calling an extract job.

I send a value '2007-01-01' through sequence_TOP to sequence_LOW and which in turn passes it to the extract job. The parameter type is declared as 'DATE' in both sequence_LOW and extract job.

But when I use this value in SQL query (on oracle) in extract job. It gives error

Code: Select all

ORA-00932: inconsistent datatypes: expected DATE got NUMBER
I even tried passing time - '2007-01-01 00:00:00'

If I use single quotes in the query to encapsulated the parameter, it works fine.

If it doesn't work this way, what is the use of parameter of type Date (not being sarcastic :oops: )
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

I don't use Sequences much, but I would pass everything as a string then use the Oracle TO_DATE function in your query.

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

Post by DSguru2B »

Can you post your sql query.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
mystuff
Premium Member
Premium Member
Posts: 200
Joined: Wed Apr 11, 2007 2:06 pm

Post by mystuff »

So the date function is it to just check if the passed value is date format and not to use within oracle plugin?
mystuff
Premium Member
Premium Member
Posts: 200
Joined: Wed Apr 11, 2007 2:06 pm

Post by mystuff »

SQL Query

Code: Select all

select * from tablename where column_of_type_date>#ReadDate#
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

In this case you do need quotes around your date.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply