Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DELIMITER $$
- USE `testmysql_startapp`$$
- DROP PROCEDURE IF EXISTS `demoSpInOutSqlVars`$$
- CREATE PROCEDURE `demoSpInOutSqlVars`(IN pInput_Param INT, /* PHP Variable will bind to this*/
- /* --- */
- INOUT pInOut_Param INT, /* SQL User variable that will be read and set by mysql */
- OUT pOut_Param INT)
- BEGIN
- /*
- * Pass the full names of SQL User Variable for these parameters. e.g. @varInOutParam
- * These 'SQL user variables names' are the variables that Mysql will use for:
- * 1) finding values
- * 2) storing results
- *
- * It is similar to 'variable variables' in PHP ;-/
- */
- SET pInOut_Param := ABS(pInput_Param) + ABS(pInOut_Param); /* always positive sum */
- SET pOut_Param := ABS(pInput_Param) * -3; /* always negative * 3 */
- END$$
- DELIMITER ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement