RTFM
rtfm / Perl/ DBI / std-proc.pl
.etla.org
use strict;

use DBI;

use constant DSN => 'dbi:Oracle:database=foo;port=1123';
use constant USR => 'scott';
use constant PWD => 'tiger'; # no, these are not my system details :)

use constant VARCHAR_T => { TYPE => DBI::SQL_VARCHAR };
use constant INTEGER_T => { TYPE => DBI::SQL_INTEGER };
use constant RESULT_BUFSIZ => 2048;


PROC:
{
    my $a = 23;
    my $path;
    my $success;
    my $rv;

    my $dbh = DBI->connect( DSN, USR, PWD );

    #oracle sql syntax. alter as appropriate for DB2:
    my $sth = $dbh->prepare( "BEGIN foo(?, ?, ?); END;" );

    $sth->bind_param( 1, $a) ; # 1st parameter is write-only
    $sth->bind_param_inout( 2, \$path,    RESULT_BUFSIZ, VARCHAR_T );
    $sth->bind_param_inout( 3, \$success, RESULT_BUFSIZ, VARCHAR_T );

    $rv = $sth->execute();

    # $path and $success now contain the out values of params #2 and #3
}

Valid HTML 4.01! Valid CSS! Any Browser Debian Pepperfish