Passing SQL as Parameter

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
gsym
Charter Member
Charter Member
Posts: 118
Joined: Thu Feb 02, 2006 3:05 pm

Passing SQL as Parameter

Post by gsym »

Hey Guys,

Can any one let me know why this query is not working when passed as a parameter?

select cast (count(1) as number(15)) as count,cast (sum(TRANSACTIONAMT) as number(21,2)) as amount, \' 1 \' as flag from TST

Error from director:

PS_NW_GLTXNF_SF: GenericQuery:esqlErrorHandler
Prepare failed for: GenericStmt_1
query is: select cast (count(1) as number(15)) as count,cast (sum(TRANSACTION_AMT) as number(21,2)) as amount, \ 1 \ as flag from TST
sqlcode is: -911
esql complaint: ORA-00911: invalid character
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Because (I assume) the slashes are invalid characters after the quotes are stripped, which DataStage is wont to do. Perhaps?

Code: Select all

select cast (count(1) as number(15)) as count,cast (sum(TRANSACTIONAMT) as number(21,2)) as amount, '' 1 '' as flag from TST


Note those are two single quotes, not double quotes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply