How to call DBD::Oracle's dbms_output_get from within a DBIx



Hi,

I have DBIx::Log4perl which is currently connected to a DBD::Oracle. In DBIx::Log4perl::st::execute I want to call DBD::Oracle's dbms_get_line which is usually (from applications) called like this:

@lines = $dbh->func('dbms_output_get');

As I'm in st::execute I have a $sth and can get hold of a $dbh. I imagined all I needed to do was:

$sth::SUPER::dbms_output_get();

but I get

Deep recursion on subroutine "DBD::Oracle::db::dbms_output_get" at /usr/lib/perl5/site_perl/5.8.8/DBIx/Log4perl/st.pm line 32.

When I look at dbms_output_get is see it is doing:

sub dbms_output_get {
my $dbh = shift;
my $sth = $dbh->prepare_cached("begin dbms_output.get_line(:l, :s); end;
")
or return;
my ($line, $status, @lines);
# line can be greater that 255 (e.g. 7 byte date is expanded on output)
$sth->bind_param_inout(':l', \$line, 400, { ora_type => 1 });
$sth->bind_param_inout(':s', \$status, 20, { ora_type => 1 });
if (!wantarray) {
$sth->execute or return undef;
return $line if $status eq '0';
return undef;
}
push @lines, $line while($sth->execute && $status eq '0');
return @lines;
}

Any ideas how I can call dbms_output_get from within DBIx::Log4perl::st::execute? or is this impossible?

Thanks

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
.



Relevant Pages

  • Re: How to call DBD::Oracles dbms_output_get from within a DBIx
    ... which is usually (from applications) called like this: ... As I'm in st::execute I have a $sth and can get hold of a $dbh. ... sub execute { ...
    (perl.dbi.users)
  • Re: finishing sth using Childhandles
    ... undef $dbh; ... <- DESTROY= undef ... and then calls the DESTROY for the dbh. ... Toute utilisation de ce ...
    (perl.dbi.users)
  • Re: finishing sth using Childhandles
    ... active sth. ... dbh or sth, I can update the dbh to turn off syb_flush_finish, which is quite logical and should be done by the client ... at that time the dbh may well be in a bad state since it's right after a signal interrupt. ... Toute utilisation de ce ...
    (perl.dbi.users)
  • Re: swap_inner_handle
    ... I create a new dbh and swap its inner handle with dbh. ... Now is sth a child of dbh or new_dbh? ...
    (perl.dbi.users)
  • Re: swap_inner_handle
    ... I create a new dbh and swap its inner handle with dbh. ... Now is sth a child of dbh or new_dbh? ... Ok so now sth and new_sth are children of the same inner dbh, and no reparenting is being done when I swap them. ...
    (perl.dbi.users)

Quantcast