0

I have created two tables in mysql for one of the project similar to e-commerce website. One table for transaction progress and other for the details for each transaction status. So, While updating the particular transaction..I should be able to insert rows in to two tables. I know we can insert it by querying separately. I am curious, if there is a way other than this..

3

1 Answer 1

0

If you join the two tables and create a view you can achieve updating two tables with a single query. This would allow you to perform an insert operation on the view, you will just have to set up triggers for “on insert” of the view to handle inserting into the appropriate tables.

I have done this with MS Sql and Postgres but the same functionality should exist is MySQL.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.