Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is this SQL Stament correct ??? ** URGENT **

 
vikas de
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 320
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
vikas de
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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()+ "'");
 
sanjiv chawan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic