Unable to pass Apostrophe to Oracle Stage as 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
satkolli
Participant
Posts: 14
Joined: Thu Jun 05, 2008 12:26 pm

Unable to pass Apostrophe to Oracle Stage as parameter

Post by satkolli »

I have a DS8.1 Parallel job which uses the Oracle Enterprise stage to Select data with the SQL below:
select custnum, custname, type from Customer where #FilterVal#

The String parameter "FilterVal" value is defined in the job as type = 'A'

When running the job I get the errors:
Message: ORA-00936: missing expression
Error occurred during initializeFromArgs().
The provided query statement did not prepare correctly;
please verify that your statement is correct;
select custnum, custname, type from Customer where type = A


It looks like when the job is passing the FilterVal parameter value, the apostrophe surrounding the A is missing in the Select SQL statement. When I view the data on the Oracle stage then it shows me data. Only when running the job manually or a sequence do I get the errors due to the missing apostrophes. Any idea how I can pass the proper statement "type = 'A'" into the Oracle Enterprise stage?

[Note - spelling corrected - Andy]
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

A search here should have turned your answer up pretty easily:

http://www-304.ibm.com/support/docview. ... wg21386517
-craig

"You can never have too many knives" -- Logan Nine Fingers
satkolli
Participant
Posts: 14
Joined: Thu Jun 05, 2008 12:26 pm

Post by satkolli »

Thank you very much Craig. I guess I was not putting the proper search parameters to find the article you attached. The word apostrophe was throwing it off! I was doing a Google search... will try the IBM site next time too.

As the article mentioned I added the UserDefined Parameter APT_OSL_PARAM_ESC_SQUOTE (with a Value = 1) in the DS Administrator. After adding it to the job there were no errors on the run. Got the required output.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Note also that the correct spelling is "apostrophe".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply