MYSQL out parameter

Discussion in 'Databases' started by 2ofus, Jul 27, 2019.

  1. #1
    Iḿ very new to sql; I wrote the following stored procedure but I do not receive the out parameter with the correct result (allways null).
    ...................
    CREATE DEFINER=`myDB`@`localhost` PROCEDURE `testSP`(in _SN varchar(20), in _ProdLine int, out Result tinyint)
    BEGIN
      Declare exit handler for sqlexception select Result = 1;
      
      insert into testTB (DateTime, SN, ProdLine) values (Current_Timestamp(), _SN, _ProdLine);
      select Result = 0;
    END
    Code (markup):
    ..............
    Which error am I doing ?
    Thanks
     
    Last edited by a moderator: Jul 27, 2019
    2ofus, Jul 27, 2019 IP