DBD-Oracle
view release on metacpan or search on metacpan
lib/DBD/Oracle.pm view on Meta::CPAN
$dbh->func( @text, 'dbms_output_put' );
# . . . and retrieve it later
@text = $dbh->func( 'dbms_output_get' );
Example 2:
$dbh->{RaiseError} = 1;
$sth = $dbh->prepare(q{
DECLARE tmp VARCHAR2(50);
BEGIN
SELECT SYSDATE INTO tmp FROM DUAL;
dbms_output.put_line('The date is '||tmp);
END;
});
$sth->execute;
# retrieve the string
$date_string = $dbh->func( 'dbms_output_get' );
=head2 B<dbms_output_enable ( [ buffer_size ] )>
This function calls DBMS_OUTPUT.ENABLE to enable calls to package
DBMS_OUTPUT procedures GET, GET_LINE, PUT, and PUT_LINE. Calls to
these procedures are ignored unless DBMS_OUTPUT.ENABLE is called
first.
The buffer_size is the maximum amount of text that can be saved in the
buffer and must be between 2000 and 1,000,000. If buffer_size is not
given, the default is 20,000 bytes.
=head2 B<dbms_output_put ( [ @lines ] )>
This function calls DBMS_OUTPUT.PUT_LINE to add lines to the buffer.
If all lines were saved successfully the function returns 1. Depending
on the context, an empty list or undef is returned for failure.
If any line causes buffer_size to be exceeded, a buffer overflow error
is raised and the function call fails. Some of the text might be in
the buffer.
=head2 B<dbms_output_get>
This function calls DBMS_OUTPUT.GET_LINE to retrieve lines of text from
the buffer.
In an array context, all complete lines are removed from the buffer and
returned as a list. If there are no complete lines, an empty list is
returned.
In a scalar context, the first complete line is removed from the buffer
and returned. If there are no complete lines, undef is returned.
Any text in the buffer after a call to DBMS_OUTPUT.GET_LINE or
DBMS_OUTPUT.GET is discarded by the next call to DBMS_OUTPUT.PUT_LINE,
DBMS_OUTPUT.PUT, or DBMS_OUTPUT.NEW_LINE.
=head2 B<reauthenticate ( $username, $password )>
Starts a new session against the current database using the credentials
supplied. Note that this does not work with DRCP.
=head2 B<private_attribute_info>
$hashref = $dbh->private_attribute_info();
$hashref = $sth->private_attribute_info();
Returns a hash of all private attributes used by DBD::Oracle, for either
a database or a statement handle. Currently, all the hash values are undef.
=head1 ATTRIBUTES COMMON TO ALL HANDLES
=head2 B<InactiveDestroy> (boolean)
Implemented by DBI, no driver-specific impact.
=head2 B<RaiseError> (boolean, inherited)
Forces errors to always raise an exception. Although it defaults to off, it is recommended that this
be turned on, as the alternative is to check the return value of every method (prepare, execute, fetch, etc.)
manually, which is easy to forget to do.
=head2 B<PrintError> (boolean, inherited)
Forces database errors to also generate warnings, which can then be filtered with methods such as
locally redefining I<$SIG{__WARN__}> or using modules such as C<CGI::Carp>. This attribute is on
by default.
=head2 B<ShowErrorStatement> (boolean, inherited)
Appends information about the current statement to error messages. If placeholder information
is available, adds that as well. Defaults to true.
=head2 B<Warn> (boolean, inherited)
Enables warnings. This is on by default, and should only be turned off in a local block
for a short a time only when absolutely needed.
=head2 B<Executed> (boolean, read-only)
Indicates if a handle has been executed. For database handles, this value is true after the L</do> method has been called, or
when one of the child statement handles has issued an L</execute>. Issuing a L</commit> or L</rollback> always resets the
attribute to false for database handles. For statement handles, any call to L</execute> or its variants will flip the value to
true for the lifetime of the statement handle.
=head2 B<TraceLevel> (integer, inherited)
Sets the trace level, similar to the L</trace> method. See the sections on
L</trace> and L</parse_trace_flag> for more details.
=head2 B<Active> (boolean, read-only)
Indicates if a handle is active or not. For database handles, this indicates if the database has
been disconnected or not. For statement handles, it indicates if all the data has been fetched yet
or not. Use of this attribute is not encouraged.
=head2 B<Kids> (integer, read-only)
Returns the number of child processes created for each handle type. For a driver handle, indicates the number
of database handles created. For a database handle, indicates the number of statement handles created. For
( run in 0.888 second using v1.01-cache-2.11-cpan-13bb782fe5a )