如何使用 perl 和 fbi 针对 sql server 检索存储过程的返回值? 有人可以举个例子吗?
最佳答案
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)。
关于Perl Dbi 和存储过程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3051735/