aspose file tools*
The moose likes JDBC and the fly likes If and else statements in SQL Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "If and else statements in SQL Query" Watch "If and else statements in SQL Query" New topic
Author

If and else statements in SQL Query

Melvin Reynold
Greenhorn

Joined: Jun 12, 2009
Posts: 15
Im getting this error using Aqua Data Studio for below query. Thanks.

>[Error] Script lines: 1-13 -------------------------
ERROR: syntax error at or near "IF"
Line: 1

Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30780
    
157

Melvin,
To the best of my knowledge, SQL doesn't have an if statement. Is that a database specific command/stored procedure? What database are you using?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Melvin Reynold
Greenhorn

Joined: Jun 12, 2009
Posts: 15
Im using this statement in XML. For the database i think its DB2.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: If and else statements in SQL Query