MySQL Forums
Forum List  »  InnoDB

Update a row or insert if don´t exist
Posted by: Francisco Morales
Date: May 20, 2005 04:45PM

Hello, I am trying to insert a rown if dont exist on the table or update it if
exits, i am trying with this code, but it doent works.

UPDATE productosdet set pro_id = '1' WHERE pro_id = '1'
ELSE INSERT INTO productosdet (productosdet_id, posicion_id, pro_id,
seccion_id, parent_id) values ('', '', '', 20, 1)

Anybody knows how can I do it ??

thanks a lot.

Options: ReplyQuote


Subject
Views
Written By
Posted
Update a row or insert if don´t exist
12720
May 20, 2005 04:45PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.