首页 > 数据库 > 数据库开发技术 > perl调用存储过程
PERL DB中的使用说明:
--一般调用方式:
$csr = $db->prepare(q{
BEGIN
PLSQL_EXAMPLE.PROC_NP;
END;
});
$csr->execute;
--带传入参数的调用
my $err_code = -20001;
$csr = $db->prepare(q{
BEGIN
PLSQL_EXAMPLE.PROC_IN(:err_code);
END;
});
$csr->bind_param(":err_code", $err_code);
eval {
$csr->execute;
};
--带传入,输出参数的调用
my $test_num = 5;
my $is_odd;
$csr = $db->prepare(q{
BEGIN
PLSQL_EXAMPLE.PROC_IN_INOUT(:test_num, :is_odd);
END;
});
# The value of $test_num is _copied_ here
$csr->bind_param(":test_num", $test_num);
$csr->bind_param_inout(":is_odd", $is_odd, 1);
# The execute will automagically update the value of $is_odd
$csr->execute;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7916042/viewspace-1010133/ ,如需转载,请注明出处,否则将追究法律责任。