Multiple updation of tables?

They have: 2 posts

Joined: May 2008

hi
I want to update 2 tables with the help of store procedure.How Possible, if both table have same id.

Thanks in advance.

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Well, yes this is certainly possible. It's a bit difficult to help without knowing the specifics, have you read the MySQL documentation on stored procedures?

Talking abstractly, you'll need a procedure that receives the id as a parameter, then updates both tables. Sounds pretty straight-forward. Another way to do it is using a trigger, that updates the second table whenever the first is written to.

Again, let us know some details of what you're trying to do and where you're getting stuck and we'll try to help. Smiling

a Padded Cell our articles site!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.