hi guys... is this SQL Statement Correct ??? int result=stmt.executeUpdate("update +tempKlasse+" set ReligionEthik='" +rfach +"' where Student like '" +studentTextField1[i].getText()+ "'"); Thanx
John Bateman
Ranch Hand
Joined: Mar 09, 2000
Posts: 320
posted
0
Originally posted by vikas de: hi guys... is this SQL Statement Correct ??? int result=stmt.executeUpdate("update +tempKlasse+" set ReligionEthik='" +rfach +"' where Student like '" +studentTextField1[i].getText()+ "'"); Thanx
I guess being the devil's advocate I have to ask you the following questions: 1> What happens when you compile/run it? 2> What is the query suppossed to do?
SOURCE CODE should be SURROUNDED by "code" tags.
vikas de
Ranch Hand
Joined: Feb 07, 2001
Posts: 39
posted
0
hi 1.)it displays " a unclosed Character literal " and ) excepted 2.)i want to update a table,where the user can decide which table he wants to update... But i have solved the problem... thank u anyway
[This message has been edited by vikas de (edited April 03, 2001).]
Michael Arnett
Ranch Hand
Joined: Mar 22, 2001
Posts: 65
posted
0
int result=stmt.executeUpdate("update +tempKlasse+" set ReligionEthik='" +rfach +"' where Student like '" +studentTextField1[i].getText()+ "'"); Shouldn't you statement include a double quote after update. For example ... int result=stmt.executeUpdate("update " + tempKlasse + " set ReligionEthik='" +rfach +"' where Student like '" +studentTextField1[i].getText()+ "'");
Sun Certified Programmer for the Java 2 Platform 1.4
sanjiv chawan
Greenhorn
Joined: Apr 04, 2001
Posts: 2
posted
0
No this is not correct.... The correct statement is int result=stmt.executeUpdate(" update "+tempKlasse+" set ReligionEthik='" +rfach +"' where Student like '" +studentTextField1[i].getText()+ "'"); Bye Ashish
Originally posted by vikas de: hi guys... is this SQL Statement Correct ??? int result=stmt.executeUpdate("update +tempKlasse+" set ReligionEthik='" +rfach +"' where Student like '" +studentTextField1[i].getText()+ "'"); Thanx