qrb*_*baQ 2 perl stored-procedures dbi
如何通过使用perl和针对sql server的dbi来检索存储过程的返回值?有人可以举例吗.
DBD :: ODBC t/dir中有一些示例(请参阅20SqlServer.t).基本上你做(不是一个完整的工作例子):
my $output;
my $input = 'fred';
my $sth = $dbh->prepare(q/{ ? = call myproc(?) }/);
$sth->bind_param_inout(1, \$output, 100);
$sth->bind_param(2, $input);
$sth->execute
Run Code Online (Sandbox Code Playgroud)
现在$ output应包含您返回的任何程序.确保在bind_param_inout中设置了足够的长度(上面的100).
| 归档时间: |
|
| 查看次数: |
4096 次 |
| 最近记录: |