in reply to PL/SQL Functions.

bind_param_inout is meant for stored procedures, not for functions.
For functions use a combination of bind_col and placeholders.

Replies are listed 'Best First'.
Re: Re: PL/SQL Functions.
by jorg (Friar) on May 29, 2001 at 18:23 UTC
    The DBD::Oracle documentation specifies that one can (not saying should) use bind_param_inout for stored functions.

    Snippet from DBD::Oracle docs (comes installed with DBD::Oracle, search for DBD/Oracle.html in your Perl source tree)
    # Example 4 # # What about the return value of a PLSQL function? # Well treat it the same as you would a call to a function # from SQL*Plus. We add a placeholder for the return value # and bind it with a call to bind_param_inout so # we can access it's value after execute. my $whoami = ""; $csr = $db->prepare(q{ BEGIN :whoami := PLSQL_EXAMPLE.FUNC_NP; END; }); $csr->bind_param_inout(":whoami", \$whoami, 20); $csr->execute; print "Your database user name is $whoami\n"; $db->disconnect;


    Jorg

    "Do or do not, there is no try" -- Yoda