File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and Relational Databases and the fly likes insertion with condition query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "insertion with condition query" Watch "insertion with condition query" New topic
Author

insertion with condition query

rajesh mahendran
Greenhorn

Joined: Feb 17, 2013
Posts: 9
I fetched both the values total and reg and i need to know that how to insert a query with checking it with the condition



anyone help thanks in advance
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19659
    
  10

I don't think that's valid SQL. The bad part is, I don't even understand what you want to do with it. Perhaps you could start by explaining that. For example: what's "regno"? A database column? A Java variable?
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2541
    
  10

Paul Clapham wrote:I don't think that's valid SQL. ...


True. A where statement only works (and only makes sense) on existing rows. And insert is used to add a new row. The two contradict each other.


OCUP UML fundamental and ITIL foundation
youtube channel
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: insertion with condition query
 
jQuery in Action, 3rd edition