存储过程OUT和INOUT类型怎么传参? DROP PROCEDURE IF EXISTS `proc_test`;CREATE DEFINER = `root`@`%` PROCEDURE `proc_test`( `h_serial` char(7), OUT `result` tinyint(1))BEGIN SET `result` = 1;END;上面是我的存储过程我传入:'1','1'提示错的'1'提示也是错的应该怎么传? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 mysql> DROP PROCEDURE IF EXISTS `proc_test`;Query OK, 0 rows affected, 1 warning (0.00 sec)mysql>mysql> delimiter //mysql> CREATE PROCEDURE `proc_test`( -> `h_serial` char(7), -> OUT `result` tinyint(1)) -> BEGIN -> SET `result` = 1; -> END; -> //Query OK, 0 rows affected (0.08 sec)mysql> delimiter ;mysql>mysql> call proc_test(1,@x);Query OK, 0 rows affected (0.03 sec)mysql> select @x;+------+| @x |+------+| 1 |+------+1 row in set (0.00 sec)mysql> DELIMITER $$CREATE PROCEDURE `test`.`dd`(`h_serial` CHAR(7), OUT `result` TINYINT(1)) /*LANGUAGE SQL BEGINSET `result`=1; END$$DELIMITER ;CALL dd(1,@ee);SELECT @ee; mysql> delimiter //mysql> create procedure pro_test( -> h_serial char(7), -> out result tinyint(1)) -> begin -> set result=1; -> end; -> //Query OK, 0 rows affected (0.02 sec)mysql> call pro_test('1',@x)//Query OK, 0 rows affected (0.00 sec)mysql> select @x//+------+| @x |+------+| 1 |+------+1 row in set (0.00 sec) php: mysql_query("call pro_test('1',@x)"); mysql_query("select @x"); 求一条sql语句 postgres历史记录占满了硬空间清理问题 mysql竟然存在如此大的bug? 为什么我在mysql中不能建一个可以从任何机子都能登录的帐号 上海一氏软件科技有限公司,急切诚聘网络游戏服务器段设计程序员 mysql 线程池的处理 求一个 mysql 查询分组与塞选 语句 数据库多表查询,求帮忙拼一个sql语句 SQL語法錯誤 mysql查询 Mysql trigger 问题 获得所取时间的当月最后一天
Query OK, 0 rows affected, 1 warning (0.00 sec)mysql>
mysql> delimiter //
mysql> CREATE PROCEDURE `proc_test`(
-> `h_serial` char(7),
-> OUT `result` tinyint(1))
-> BEGIN
-> SET `result` = 1;
-> END;
-> //
Query OK, 0 rows affected (0.08 sec)mysql> delimiter ;
mysql>
mysql> call proc_test(1,@x);
Query OK, 0 rows affected (0.03 sec)mysql> select @x;
+------+
| @x |
+------+
| 1 |
+------+
1 row in set (0.00 sec)mysql>
OUT `result` TINYINT(1))
/*LANGUAGE SQL
BEGIN
SET `result`=1;
END$$DELIMITER ;CALL dd(1,@ee);
SELECT @ee;
mysql> create procedure pro_test(
-> h_serial char(7),
-> out result tinyint(1))
-> begin
-> set result=1;
-> end;
-> //
Query OK, 0 rows affected (0.02 sec)mysql> call pro_test('1',@x)//
Query OK, 0 rows affected (0.00 sec)mysql> select @x//
+------+
| @x |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
mysql_query("select @x");