繁体   English   中英

Perl Dbi和存储过程

[英]Perl Dbi and stored procedures

如何通过使用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 

现在$ output应包含您返回的任何程序。 确保在bind_param_inout中设置了足够的长度(上面的100)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM