Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two Simultaneous SQL Query Problem !!

Status
Not open for further replies.

Luckyman1

Technical User
Jan 27, 2003
7
PK
Hi, I'm doing SQL in Informix but I have a problem.

I want to commit both of these SQL updates, on two separate tables, with one query. Both SQL updates, using Bea workshop weblogic, in jcx, work individually but not together.

So how can I use these together? I’ve spent lot of time and cant figure solution. Thanks here it is that I want to happen together, one query.

UPDATE trn_question_dtl
SET question_desc = "What is counselor"
WHERE question_nbr = 3

UPDATE training_Question
SET question_type_code = 04
WHERE question_nbr = 3
 
Wrap them within a transaction.

I haven't looked at Informix in years, but I think it's just the standard begin transaction commit transaction statements.

Code:
BEGIN TRANSACTION
UPDATE trn_question_dtl
SET question_desc = "What is counselor"
WHERE question_nbr = 3

UPDATE training_Question
SET question_type_code = 04
WHERE question_nbr = 3
COMMIT TRANSACTION

That will commit them at the same time.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top