Page 1 of 1

Unexpected token error in Db2 OS390 Platform

Posted: Wed Dec 27, 2006 4:30 am
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

Posted: Wed Dec 27, 2006 7:03 am
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

Posted: Thu Dec 28, 2006 12:39 am
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.

Posted: Thu Dec 28, 2006 6:14 am
by ray.wurlod
The space is for the sign. For example, -3.3 and +3.5 are valid decimal numbers, as is 3.2.

Posted: Thu Dec 28, 2006 8:30 am
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.

Posted: Thu Dec 28, 2006 4:14 pm
by ray.wurlod
Technically it's an issue of SQL syntax, not a DataStage issue. Arguably it's an issue of (SQL) standards compliance.