Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

ILLEGAL USE OF KEYWORD EXCEPT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Rishi Khare

New User


Joined: 13 Aug 2007
Posts: 16
Location: Mumbai

PostPosted: Tue Oct 14, 2008 5:48 pm    Post subject: ILLEGAL USE OF KEYWORD EXCEPT
Reply with quote

i need to compare two tables

SELECT COUNT(*) FROM (
(SELECT * FROM t1 AS A
EXCEPT(SELECT * FROM t2) AS B
UNION ALL
(SELECT * FROM t2) AS C
EXCEPT(SELECT * FROM t1) AS D
)


DSNT408I SQLCODE = -199, ERROR: ILLEGAL USE OF KEYWORD EXCEPT. TOKEN FULL
LEFT INNER RIGHT WAS EXPECTED
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8051
Location: East Dubuque, Illinois, USA

PostPosted: Tue Oct 14, 2008 5:51 pm    Post subject:
Reply with quote

Even for a non-DB2 person like me, the message is quite clear -- it wants FULL, LEFT, INNER, or RIGHT and you gave it EXCEPT. Fix the problem and proceed.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Oct 14, 2008 5:54 pm    Post subject:
Reply with quote

And for another non DB2 person like me - it is pretty clear that this should have been perhaps posted in the DB2 forum !!!
Back to top
View user's profile Send private message
Suresh Ponnusamy

Active User


Joined: 22 Feb 2008
Posts: 107
Location: New York

PostPosted: Tue Oct 14, 2008 10:35 pm    Post subject:
Reply with quote

Hi Rishi

Your synax is wrong. Probably try the below one.
SELECT COUNT(*)
FROM
(
(
(SELECT * FROM t1 A)
EXCEPT
(SELECT * FROM t2 B)
) E
UNION ALL
(
(SELECT * FROM t2 C)
EXCEPT
(SELECT * FROM t1 D)
) F
) G;;


Please note that I have not tested the above query since I am not having DB2 9 in my system. EXCEPT is DB2 9 function.

Suggestions are welcome.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Illegal use of keyword fetch. Token w... HABBIE DB2 2 Fri Aug 28, 2015 5:20 pm
No new posts Illegal symbol syntax error HABBIE DB2 5 Wed Aug 26, 2015 5:58 pm
No new posts IFTHEN & BUILD - If keyword match... Roach_MF DFSORT/ICETOOL 4 Wed Mar 18, 2015 1:21 am
No new posts COBOL 5.1 and the UNBOUNDED Keyword Bill O'Boyle COBOL Programming 2 Tue Apr 29, 2014 7:31 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us