I wanted possible DBI error(s) to be reported not from
the wrapper, but from place the wrapper was called.
The root cause is a modul for a free interpolation of bounded parameters into SQL text. Something like code below.
I wanted my object (text with bindings) could be used
instead of SQL text (in ->selectrow_array, ->do, ...)
I actually wrapped the DBI stuff but I wanted to do it more elegantly without rereporting the errors.
use Akar::DBI::Statement qw(sql_param sql sql_param_inout);
use Interpolation 'E' => 'eval',
'sqlp' => sub { return sql_param(@_) };
....
my $is_alive;
my $is_alive_sqlp = sql_param_inout( \$is_alive, 20 );
$this->db_Main->do(<<"END_PSQL");
BEGIN
if DBMS_SESSION.IS_SESSION_ALIVE(
$sqlp{ $this->usessionid}
)
then
$is_alive_sqlp := 1;
else
$is_alive_sqlp := 0;
end if;
END;
END_PSQL
|