Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hey, Clueless - Here you go!

$DBH=DBI->connect($task->{$DATA_SOURCE},$task->{$USERNAME},$task-> +{$PASSWORD}, { HandleError=>Exception::Class::DBI->handler,LongReadLen=>409 +6,PrintError=>1,RaiseError=>1 }); ################################################### # A Allocate some memory for dbms_output to use! $DBH->func(1_000_000,'dbms_output_enable'); my $SQL=<<"_SQL_"; -- <Your select goes here!> SELECT ... as something FROM ...-- no ";" _SQL_ $DBH->do(<<"_SQL_"); BEGIN dbms_metadata.set_transform_param(dbms_metadata.session_tr +ansform,'PRETTY',true); dbms_metadata.set_transform_param(dbms_metadata.session_tr +ansform,'SQLTERMINATOR',true); dbms_metadata.set_transform_param(dbms_metadata.session_tr +ansform,'STORAGE',false); FOR row IN ($SQL) LOOP -- use dbms_output.put_line to stash the results dbms_output.put_line(row.something); END LOOP; END; _SQL_ # Get the contents stashed in dbms_output my @lines=$DBH->func('dbms_output_get'); # Do something useful with @lines ################################################### $DBH->disconnect;

Adding: It appears that 1 MB is the upper limit to dbms_output's buffer size! (as of Oracle release 21)


In reply to Re: DBD::Oracle DBMS_METADATA and DBMS_OUTPUT by clueless newbie
in thread DBD::Oracle DBMS_METADATA and DBMS_OUTPUT by clueless newbie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-15 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found