Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Basically it calls the stored procedure fn in the schema foo, which creates a row in foo, and returns a cursor to a row in foo_view. I then want to return the id from this row. $return_value is undef for one use of this block, but the correct if for another.sub Create($$$) { my $dbh = shift(@_); my @parameters = @_; my $return_value; eval { my $func = $dbh->prepare(q{ DECLARE returned_cursor foo_CURSOR; returned_row foo_view%ROWTYPE; BEGIN returned_cursor := foo.fn( :parameter1, ); FETCH returned_cursor INTO returned_row; :id := returned_row.id; END; }); $func->bind_param(":parameter1", $parameters[1]); $func->bind_param_inout(":id", \$return_value, 1); $func->execute; }; <error catching> }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI bind inout problem
by olus (Curate) on Dec 04, 2006 at 12:28 UTC | |
by Anonymous Monk on Dec 04, 2006 at 13:54 UTC | |
by olus (Curate) on Dec 04, 2006 at 15:01 UTC | |
by Liche (Initiate) on Dec 05, 2006 at 09:25 UTC | |
by olus (Curate) on Dec 05, 2006 at 10:21 UTC | |
| |
|
Re: DBI bind inout problem
by Liche (Initiate) on Dec 05, 2006 at 09:38 UTC |