• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

query for updating

 
vernon mweetwa
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is it possible to create a single query that can update 2 tables at once when executed and if it is possible, how is the syntax.

below is the query i use to update the master patient table and i would like the same query to update another table. how do i add on for the other table?

"update master_patient set forename = Substr(forename,1,1),surname=Substr(surname,1,1) where forename is not null "
[ February 10, 2005: Message edited by: Bear Bibeault ]
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
stored procedure is the answer.
 
vernon mweetwa
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone transform the given query to include the other update because using stored procedures as requested is what i don't know.

thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34073
335
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vernon,
Why can't you just make 2 JDBC calls?
 
vernon mweetwa
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeanne. I used 2 JDBC calls and it has worked.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic