Set and create user variable : Variable Declaration « Procedure Function « SQL / MySQL






Set and create user variable

     

delimiter $$

CREATE PROCEDURE USER_VARIABLE ()
BEGIN
   SET @VAR1 = 1;
END$$

delimiter ;

CALL USER_VARIABLE ()
;
SELECT @VAR1;

   
    
    
    
    
  








Related examples in the same category

1.Declare INTEGER variable in procedure
2.Prepare from a variable