Results 1 to 9 of 9
Thread: Insert and update in ONE query?
Mar 14, 2013, 00:13 #1
- Join Date
- Jun 2008
- Rockford, IL
- 22 Post(s)
- 0 Thread(s)
Insert and update in ONE query?
Is there a way to INSERT a record, and update other record records in THE SAME TABLE, BASED ON A SET CRITERIA, all in ONE QUERY?
for example... I want to insert a record that contains :
RecID, Order, RecName, OtherField5, OtherField5,OtherField5,OtherField5,OtherField5
while at the same time all updating Order to Order+1 in all rows where Order> the inserted Order.
I am dealing with a MyISAM DB, and cant use transactions so I was wondering if this simple procedure could be done in ONE query so as to prevent data corruption.
thanks in advance.Tips for better/ faster SitePoint forum answers
Brilliant ideas, elegant execution.
Graphic Design, Art Direction, Copywriting and Web Design.