Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Invoke and bind parameters to a PL/SQL Procedure

by Rocko19 (Acolyte)
on Sep 02, 2009 at 11:50 UTC ( [id://792883]=perlquestion: print w/replies, xml ) Need Help??

Rocko19 has asked for the wisdom of the Perl Monks concerning the following question:


Hi,
In my perl script, I need to invoke a procedure and pass certain parametres to it. I know that bind_param_inout is used when you need to pass parameters to a Procedure and get the return values from it. In this case, I do not require the return values. I just need to pass the parameters.

Please suggest how to pass parameters to the procedure without concerning about return values.
Thanks
Rocko

Replies are listed 'Best First'.
Re: Invoke and bind parameters to a PL/SQL Procedure
by almut (Canon) on Sep 02, 2009 at 12:03 UTC

    Just use bind_param() instead, e.g.

    $sth->bind_param(":Add_recs", $add_recs); ...
Re: Invoke and bind parameters to a PL/SQL Procedure
by olus (Curate) on Sep 02, 2009 at 12:08 UTC

    With DBI I used bind_param. Something like:

    my $csr = $dbh->prepare(q{ BEGIN schema.package.stored_procedure(:param1, :param2); END; }); $csr->bind_param(':param1', $param1); $csr->bind_param(':param2', $param2); ...
Re: Invoke and bind parameters to a PL/SQL Procedure
by dsheroh (Monsignor) on Sep 02, 2009 at 12:52 UTC
    If you're just passing parameters in, you can also use positional (rather than named) parameters, in which case you don't need to explicitly bind them at all:
    $sql = "BEGIN"."INTRA.WEB_LOG_DATA(?, ?, ?, ?, ?, ?);"."END;"; $sth = data_sources_tools::putData($dbd,$sql); $sth->execute($log_date, $add_recs, $update_recs, $delete_recs, $total +_recs, $log_file_path);
    Also note that, in current versions of Perl, you don't need to prefix user-defined function calls with & except in rare cases.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://792883]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-24 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found