Created
October 14, 2015 06:46
-
-
Save nkonev/a6ca90ade2f36fe8851a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| delimiter $$ | |
| CREATE PROCEDURE my_sp7(patch_uuid varchar(36), sql_query varchar(1024)) | |
| BEGIN | |
| IF NOT EXISTS (SELECT `uuid` FROM `patch` WHERE `uuid` = patch_uuid) THEN | |
| INSERT INTO `patch` (`uuid`) VALUES (patch_uuid); | |
| SET @mystate = sql_query; | |
| PREPARE stmt FROM @mystate; | |
| EXECUTE stmt; | |
| DEALLOCATE PREPARE stmt; | |
| END IF; | |
| END | |
| call my_sp7('uuid2', 'INSERT INTO `words` (`word_id`, `spelling`) VALUES (\'2\', \'boss\');'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment