• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using Variables to UPDATE

 
Barry Andrews
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could someone please provide a correct syntax for the following code? I am trying to use a String variable to do an update to a table. Thanks a lot!
<CODE>
String myVariable = "TableName";
updateString = "UPDATE " + myVariable +
"SET PROJECT = 'QA' " +
"WHERE PROJECT = 'SYSADM'";
</CODE>
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A space before SET PROJECT?
 
Barry Andrews
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes! Thanks!
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!