migration in laravel for PROCEDURE

  database, laravel, mysql, sql, stored-procedures

I am trying to create procedure migration in laravel but I am getting syntex error every time I tried so but didn’t make it work

Below is the code

$this->addSql("CREATE PROCEDURE Type_Store_Sync(IN name_it VARCHAR(255), IN guid VARCHAR(32), IN type VARCHAR(10), IN orgid INT(11), IN scheme VARCHAR(6)) LANGUAGE SQL
        BEGIN
            CALL mysql.lambda_async( 
  'arn:aws:lambda:eu-west-2::function:triggersync',
                CONCAT('{ "name" : ', REPLACE(name_it,'','\'), ', "guid" : ', guid,', "type" : ', type,', "orgid" : ', orgid,', "scheme" :', scheme,'"}')                
            );
        END");

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an
error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near ”), ‘, "guid"
: ‘, guid,’, "type" : ‘, type,’, "orgid" : ‘, orgid,’, "scheme" ‘

Source: Laravel

Leave a Reply