MySQL 存储过程

DELIMITER //  
  CREATE PROCEDURE save_get_donator(IN p_in int,INOUT p_inout int,OUT p_out int)  
    BEGIN  
    SELECT @p_in,@p_inout, @p_out;
    SET p_in = 1;
    SET p_inout = 3;
    SET p_out = 5;
     
    END;  
    //  
DELIMITER ;  

#调用
SET @p_in=0;  
SET @p_inout=-3;
SET @p_out=-5;
CALL save_get_donator(@p_in,@p_inout,@p_out) ;  
SELECT @p_in,@p_inout, @p_out;

相关推荐