in reply to Re^2: DBI Out parameters
in thread DBI Out parameters
You certainly can get function return values back in perl. You can also get output arguments back in procedures. I do this all the time with DBD::Oracle.
use DBI; use strict; my $h = DBI->connect('dbi:Oracle:xxx','xxx','xxx'); eval {$h->do(q{drop function fred});}; my $sql = <<'EOT'; create function fred(a integer) return integer as begin return (a + 1); end; EOT $h->do($sql); my $s = $h->prepare(q{begin ? := fred(?); end;}); $s->bind_param(2, 1); my $res; $s->bind_param_inout(1, \$res, 100); $s->execute; print "fred=$res\n";
outputs fred=2
|
|---|