User Variable Activity

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
kiran259
Participant
Posts: 48
Joined: Thu Aug 16, 2007 11:17 pm
Location: United States
Contact:

User Variable Activity

Post by kiran259 »

I have a parallel job where the query is parameterized(RCP ON).
Oracle Enterprise------>Seq File
This parallel job is connected in a job sequence wherein UserVariable activity used.
A where condition is kept in the query like "where to_char(sample_date,'YYYY-MM-DD')='2010-01-25'".
I am passing '2010-01-25' as a Job Param and using in UserVar Activity.I used " \' ":test_date:" \' ".But DS is logging an error stating "query not ended properly".Same query is running successfully from SQL command line.

Any solutions will be appreciated.

Thanks
Kiran Vaduguri

As soon as the fear approaches near, attack and destroy it.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

What happens if you add a ";" to the end of your query?
kiran259
Participant
Posts: 48
Joined: Thu Aug 16, 2007 11:17 pm
Location: United States
Contact:

Post by kiran259 »

ArndW wrote:What happens if you add a ";" to the end of your query? ...
------Same error

I forgot to mention another error:ORA-00972 identifier too long.
After some search,I found that some clients do not accept VARCHAR>31.I am using Oracle 10g version.
I have columns which had VARCHAR>31.Is this creating problem?

Thanks
Kiran Vaduguri

As soon as the fear approaches near, attack and destroy it.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The contents of the columns can be larger than 31 characters, but this is referring to your column name length(s) which need to be shortened.
kiran259
Participant
Posts: 48
Joined: Thu Aug 16, 2007 11:17 pm
Location: United States
Contact:

Post by kiran259 »

All the column name lengths are <30.But still DS logging "Oracle identifier too long" and "query not ended properly" errors. :?
Kiran Vaduguri

As soon as the fear approaches near, attack and destroy it.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

could you post the full error message, which (I think) will also contain the query as seen by Oracle.
kiran259
Participant
Posts: 48
Joined: Thu Aug 16, 2007 11:17 pm
Location: United States
Contact:

Post by kiran259 »

select <schemaname.tablename.columnname>(30 column names) from <schemaname.tablename> where to_char(schemaname.tablename.test_date,'YYYY-MM-DD')='2010-07-25'----Query used

I checked with select * from <tablename> where to_char(test_date,'YYYY-MM-DD')='2010-07-25'.

Errors logging for both:
Message:ORA-00972:Identifier too long
Statement:"select <schemaname.tablename.columnname>(30 column names) from <schemaname.tablename> where to_char(schemaname.tablename.test_date,'YYYY-MM-DD')='2010-07-25'" Provided query statement did not prepare correctly

The same query is running fine in parallel job but problem aroused in job sequence where User Variable Activity is used for passing test_date at run time.
Kiran Vaduguri

As soon as the fear approaches near, attack and destroy it.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Did you replace the text "schemaname" in the post or is that what is displayed? Cut-and-Paste your datastage SQL into the tool of your choice and see if it works or also shows an error.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

kiran259 wrote:After some search,I found that some clients do not accept VARCHAR>31.I am using Oracle 10g version.
If this is true, then perhaps you need to install an updated Oracle client.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kiran259
Participant
Posts: 48
Joined: Thu Aug 16, 2007 11:17 pm
Location: United States
Contact:

Post by kiran259 »

The mistake done by me was appending double quotes at the front and rear ends of the query in UserVar Activity.It was running successfully after I remove them.But DS puzzled me giving the Oracle:identifier too long... :?

Thanks for your help
Kiran Vaduguri

As soon as the fear approaches near, attack and destroy it.
Post Reply