1

I have created a function in oracle 11g r2, I would like to call that function while inserting a record.

Following is my code block.

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.
mpapec
  • 50,217
  • 8
  • 67
  • 127

1 Answers1

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

$sth->execute($i, $amount, $amount);
mpapec
  • 50,217
  • 8
  • 67
  • 127