DBD-Oracle

 view release on metacpan or  search on metacpan

README.mkdn  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' );

## **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.

## **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.

## **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.

## **reauthenticate ( $username, $password )**

Starts a new session against the current database using the credentials
supplied. Note that this does not work with DRCP.

## **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.

# ATTRIBUTES COMMON TO ALL HANDLES

## **InactiveDestroy** (boolean)

Implemented by DBI, no driver-specific impact.

## **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.

## **PrintError** (boolean, inherited)

Forces database errors to also generate warnings, which can then be filtered with methods such as
locally redefining _$SIG{\_\_WARN\_\_}_ or using modules such as `CGI::Carp`. This attribute is on
by default.

## **ShowErrorStatement** (boolean, inherited)

Appends information about the current statement to error messages. If placeholder information
is available, adds that as well. Defaults to true.

## **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.

## **Executed** (boolean, read-only)

Indicates if a handle has been executed. For database handles, this value is true after the ["do"](#do) method has been called, or
when one of the child statement handles has issued an ["execute"](#execute). Issuing a ["commit"](#commit) or ["rollback"](#rollback) always resets the
attribute to false for database handles. For statement handles, any call to ["execute"](#execute) or its variants will flip the value to
true for the lifetime of the statement handle.

## **TraceLevel** (integer, inherited)

Sets the trace level, similar to the ["trace"](#trace) method. See the sections on
["trace"](#trace) and ["parse\_trace\_flag"](#parse_trace_flag) for more details.

## **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.

## **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 1.281 second using v1.01-cache-2.11-cpan-13bb782fe5a )