Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2] SQL0104N An unexpected token "S" was found following "". Expected tokens may include: "UNION". SQLSTATE=42601

0 views
Skip to first unread message

Scooter DNeedle

unread,
Jun 15, 2001, 8:11:36 AM6/15/01
to
I receive the following error when running an SQL statement in my
application via JDBC. I can run the same SQL using the command center
with no problem. If I delete the record in my database that is
returned in my result set that contains an apostrophe the query
executes fine. Any Ideas??

COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2] SQL0104N An
unexpected token "S" was found following "". Expected tokens may
include: "UNION". SQLSTATE=42601

Serge Rielau

unread,
Jun 15, 2001, 9:18:18 AM6/15/01
to
Can you post the statement?

Cheers
Serge


Scooter DNeedle

unread,
Jun 18, 2001, 7:54:48 AM6/18/01
to
It is an involved SQL statement, but when I have an apostrophe in the
rollup column, that is when I receive the error.

select round(sum(wba_req_dlr),0) as reqAmt,
round(sum(wba_req_hrs)/2080,1) as reqFte, a.rollup as servLine,
c.category as cat, max(c.sort) as catSort, max(c.glcategory) as glCat,
max(c.categorydesc) as catDesc,
from S05DTDB.area a
inner join S05DTDB.accessdetail ad on ad.org = a.org and ad.area =
a.area
inner join S05DTDB.twba_opr_bdgt b on a.org = b.wba_org and a.area =
b.wba_area
inner join S05DTDB.acct ac on ac.org = b.wba_org and ac.acct =
b.wba_acct
inner join S05DTDB.org o on a.org = o.org
inner join S05DTDB.category c on c.category = ac.category
left outer join S05DTDB.accttype t on t.accttype = ad.accttype and
t.acct = ac.acct
where ad.userid = 'TCABCOO' and
(t.type = 'I' or t.type is null) and
wba_bdgt_yr = 2002
group by a.rollup, c.sort, c.glcategory, c.category
order by a.rollup, c.sort

Thanks.

Scooter DNeedle

unread,
Jul 9, 2001, 3:32:22 PM7/9/01
to
Help, anyone....any ideas.

Aakash Bordia

unread,
Jul 9, 2001, 4:45:34 PM7/9/01
to
Look at the following message and rectify your SQL statement:
db2 => ? sql0104n

SQL0104N An unexpected token "<token>" was found following
"<text>". Expected tokens may include:
"<token-list>".

Explanation: A syntax error in the SQL statement was detected at
the specified token following the text "<text>". The "<text>"
field indicates the 20 characters of the SQL statement that
preceded the token that is not valid.

As an aid to the programmer, a partial list of valid tokens is
provided in the SQLERRM field of the SQLCA as "<token-list>".
This list assumes the statement is correct to that point.

The statement cannot be processed.

User Response: Examine and correct the statement in the area of
the specified token.

sqlcode: -104

sqlstate: 42601

db2 =>
Thanks
Aakash
"Scooter DNeedle" <brad...@aurora.org> wrote in message
news:9f163bd3.0107...@posting.google.com...


Serge Rielau

unread,
Jul 9, 2001, 5:24:06 PM7/9/01
to
Hi Scooter,

Something is seriously wrong there. -104 is a compiletime error. It
should be independend of the content.
I wonder if CLI is playing some games.... You might want to do a CLI
Trace and see what is being generated under the covers....

Cheers
Serge

0 new messages