ORacle table lookup

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
srekant
Premium Member
Premium Member
Posts: 85
Joined: Wed Jan 19, 2005 6:52 am
Location: Detroit

ORacle table lookup

Post by srekant »

Hi,
I am doing direct lookup to an oracle table (having userdefined Query with multiple unions) when i run the job with out giving bind variable "the first row value of lookup is repeated for the remaining rows".
when i use a bind variable i am getting the following error

Code: Select all

"ORA-01036: illegal variable name/number"
Sree
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Post your query.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Re: ORacle table lookup

Post by rwierdsm »

I've seen this error when the input key value does not line up with ':1" value in the query, i.e. you are passing the bind variable in the 4th port, but have defined your variable as the first port (:1). Make sure they all line up, better still, ensure your key values are at the top of the list.

e.g.

Code: Select all

select x, y, z from table_1
where a = [b]:1[/b]
where the list of columns into the sql are:

column 1 (non key)
column 2 (non key)
column 3 (non key)
column 4 (key)

In this simplistic example, the SQL will be modified to be

Code: Select all

select x, y, z from table_1
where a = [b]:4[/b]
Hope this is clear?!?!?

Rob W
Rob Wierdsma
Toronto, Canada
bartonbishop.com
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Was gonna get there when the query was posted. :wink:

Biggest thing is to ensure that all columns are 'bound', that there is a parameter marker in the query for each column defined in the stage. Also, fields marked as Keys are expected to be used in the 'where' clause but I'm not sure if that is enforced when using User Defined SQL in a reference lookup.
-craig

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