How to Check for record existence and do Insert in MYSQL ?

Posted by karthik on Stack Overflow See other posts from Stack Overflow or by karthik
Published on 2010-05-10T06:26:06Z Indexed on 2010/05/10 6:34 UTC
Read the original article Hit count: 285

Filed under:
|

How to Check for record existence and do Insert or Update in MYSQL ?

I have a script, which has set of Insert statements for multiple tables.

Now when i try to execute the Insert statement, i want to do the following..

Check for the record existence and then do Insert or Update.

If the Record is not exist do Insert. If the Record is already do not do anything.

How to accomplish this ?

Note : The script with Insert Statements are generated programmaticaly using SP

© Stack Overflow or respective owner

Related posts about mysql

Related posts about mysql-query