user defined sql

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
weela_lee
Participant
Posts: 2
Joined: Tue Dec 28, 2004 8:00 pm

user defined sql

Post by weela_lee »

I have a user-defined sql in Oracle Stage, which works fine in parallel job but failed in server job.

UPDATE
test_table
SET
IS_EXPIRED = 'Y'
WHERE
(COL_ID in (666, 667) )

error message in server job is:
ORA-01722: invalid number

Does anyone know why it won't work in server job?
Thanks in advance!
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Check whether
1.) Is_Expired is a numeric datatype
2.) COL_ID is not a numeric data type

Can you run the same successfully via sqlplus or toad?
mpouet
Participant
Posts: 34
Joined: Mon Oct 18, 2004 10:23 am
Location: France

Re: user defined sql

Post by mpouet »

HI,

1) There is a space between "666," and "667" in your query.
2) Are your sure you are not supposed to use "." as decimal separator.

Good luck
Matthieu
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

The comma is meant to be there. It implies ANY option of the 2 values provided.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

And the space isn't an issue either. It can be there or not. :wink: I'm sure it will come down to column types as mentioned earlier.

Not sure why you'd want to do a query like this, one that's not tied to the current row using bind variables / parameter markers. It will be executed once for every row sent to the stage, regardless of the contents of that row. Is that really what you had in mind?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Basically, you have to track down why Oracle believes you've used an invalid number. The only possibility in your query is 'Y'. Check the data type of IS_EXPIRED (use DESCRIBE).
Last edited by ray.wurlod on Thu May 26, 2005 7:14 am, edited 2 times in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Good point Craig. Maybe the column name used as the place holder is causing the problem somewhere. But this is only a guess as there is no information on the design.
Post Reply