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

Re: executing a OSP with CGI

by arturo (Vicar)
on Jul 15, 2003 at 20:32 UTC ( [id://274564]=note: print w/replies, xml ) Need Help??


in reply to executing a OSP with CGI

This may have changed recently, but for a long time the recommended way to execute a stored procedure in Oracle through DBI is to essentially execute an anonymous procedure that calls it, like so:

$SQLString =<<END_OF_SQL; BEGIN OSP_FOO_BAR( ?, ?, ? ); END; END_OF_SQL $db->do( $SQLString, undef, $xvar, $yvar, $zvar ) or die "Can't execute $SQLString: " . $db->errstr();

In case you're unfamiliar with the notion, the ? are placeholders, whose values get replace by your x, y, and z vars in the do call. The undef in the do call is required to use placeholders with the DBI's do method (you probably don't need to know exactly why, but you do need something there).

Updated the code to fix one syntax error and misleading syntax.

This way of executing stored procedures is documented in DBD::Oracle

If not P, what? Q maybe?
"Sidney Morgenbesser"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2024-03-28 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found