Unexpected token error in Db2 OS390 Platform

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
poornimajayan
Participant
Posts: 16
Joined: Sun Apr 17, 2005 11:27 pm

Unexpected token error in Db2 OS390 Platform

Post by poornimajayan »

Hi,
In the source DRS, I am doing a UNION of 2 queries.In the first query, I have 3 decimal fields which are not there in the second query.So to compensate that in the second query, I placed 0 in their places.It works fine in Oracle.But in OS390, it fails giving the message
"An unexpected token ",0" was found following "". Expected tokens may include: ", FROM INTO". SQLSTATE=42601"
This will gets fixed if I make that 0 as a character value.Ex: if I place zero as '0'.But then my UNION won't be working properly.
Any suggestion on this is highly appreciated.
Thanks,
Poornima
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You said its a decimal field right, try 0.00 instead or whatever the prcision is, put that many zeros after the decimal. An arror in the dark
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
poornimajayan
Participant
Posts: 16
Joined: Sun Apr 17, 2005 11:27 pm

Post by poornimajayan »

Hi Guru,
Thanks for the idea.It works with some extension of that.In the selct query, I put a space after the comma and then put 0.0.
Ex:select x,y, 0.0 from a; where there is a space after the comma (which is there in the suffix of y).
Awkward.Right?
Thanks again
Poornima.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The space is for the sign. For example, -3.3 and +3.5 are valid decimal numbers, as is 3.2.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

ray.wurlod wrote:The space is for the sign. For example, -3.3 and +3.5 are valid decimal numbers, as is 3.2.
Many people are unaware of this fact. Maybe someone should put up a FAQ for this.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Technically it's an issue of SQL syntax, not a DataStage issue. Arguably it's an issue of (SQL) standards compliance.
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