Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DELIMITER //
- CREATE PROCEDURE ins_upd (in x int(10), in y varchar(20))
- begin
- if (x IN (SELECT ID FROM my_table) then
- UPDATE my_table SET ID=x, NAME=y;
- else
- INSERT INTO my_table values (x, y);
- end if;
- end//
Add Comment
Please, Sign In to add comment