Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: executing a OSP with CGI

by arturo (Vicar)
on Jul 15, 2003 at 20:32 UTC ( #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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://274564]
[virtualsue]: a veterinarian told me to cut down on my cat's food. i said, when i do that she just catches more mice
[thezip]: My dogs are also excellent mousers, at least that's what they tell me.
[GotToBTru]: our beagle has dispatched 3 rabbits to the Great Hutch in the Sky since March.
[thezip]: I can always tell when the dogs have been mousing, as there is a concentric ring of mud around the end of their snouts when they do.
[thezip]: As for more physical evidence, that always seems to be missing somehow
[Rabbi Bob]: We have a Jack Russell: off the leash she is a torpedo against mice, rats, chipmunks and squirrels
[Rabbi Bob]: Doesn't eat them, just snaps, kills, drops and moves on.
[thezip]: Efficient, that one.

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (14)
As of 2017-11-17 19:57 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (272 votes). Check out past polls.