This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes SQL stmt Not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "SQL stmt Not working" Watch "SQL stmt Not working" New topic

SQL stmt Not working

Gorakshanath Pandey

Joined: Feb 25, 2004
Posts: 11
sql = "INSERT INTO temper1 "
+"(SELECT erter, fy_tax, quarter, regional,activityregion,f_method "
+"FROM risma t1, fyquarter t2,cases t3 "
+"where t3.riscas= 'D' "
+"and (t1.cntl_no= t3.cntl_no "
+"and (t1.entry_21 between t2.stdate and t2.eddate "
+"or t1.closed_cc_dt between t2.stdate and t2.eddate)) )";
Some problem with syntax...
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Have you tried running the query in a database client before doing it in Java? It's much easier to debug SQL there first.
rocket mass heater kickstarter
subject: SQL stmt Not working