Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SQL merge

 
thejwal pavithran
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have followed the DB2 documentation for MERGE and have come up with the below statement.

      

But this is failing with the below error:

Keyword SOURCE not expected. Valid tokens: FULL LEFT CROSS INNER RIG

I am not understanding whats wrong here. Can someone please help?
 
Paul Clapham
Sheriff
Posts: 21961
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see from the documentation that "SOURCE" is a keyword in DB2. That would mean that you can't use it as an alias. Could you change it to something else which isn't a DB2 keyword?
 
thejwal pavithran
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works like a Gem! Thanks Paul. Why the hell would IBM give such kind of an example in their documentation???
 
Paul Clapham
Sheriff
Posts: 21961
36
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If that's an example from their documentation, then I'd agree with you, it's pretty careless.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!