1

我在 oracle 11g r2 中创建了一个函数,我想在插入记录时调用该函数。

以下是我的代码块。

my $SQL="insert into sample values ( :sno, :amount , :func )";
my $sth =$dbh-> prepare($SQL);
$sth->bind_param(":amount" , $amount );
$sth->bind_param(":sno" , $i);

$sth->bind_param(":func" , my_func($amount)); 
$sth-> execute();
# I want the third parameter to be output of the function my_func.
4

1 回答 1

3
my $SQL = "insert into sample values (?, ?, my_func(?))";
my $sth = $dbh->prepare($SQL);

$sth->execute($i, $amount, $amount);
于 2014-04-25T07:15:13.873 回答