wood burning stoves 2.0*
The moose likes JDBC and the fly likes query for updating Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "query for updating" Watch "query for updating" New topic
Author

query for updating

vernon mweetwa
Greenhorn

Joined: Nov 26, 2004
Posts: 24
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

Joined: Aug 15, 2004
Posts: 2874
stored procedure is the answer.
vernon mweetwa
Greenhorn

Joined: Nov 26, 2004
Posts: 24
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

Joined: May 26, 2003
Posts: 31074
    
232

Vernon,
Why can't you just make 2 JDBC calls?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
vernon mweetwa
Greenhorn

Joined: Nov 26, 2004
Posts: 24
Thanks Jeanne. I used 2 JDBC calls and it has worked.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: query for updating