Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: executing a OSP with CGI

by blue_cowdawg (Monsignor)
on Jul 15, 2003 at 19:24 UTC ( #274538=note: print w/replies, xml ) Need Help??

in reply to executing a OSP with CGI

Perhaps a better way would be to:

my $sth=$dbh->prepare("exec OSP_FOO_BAR(?,?,?)") or die $dbh->errstr; $sth->execute($xvar,$yvar,$zvar) or die $sth->errstr;
This way you can capture any errors you generate and you are allowing the DBI interface to do what it does very well and handle any necessary type coversions for your variables.

Hope this helps.

Peter L. BergholdBrewer of Belgian Ales
Unix Professional

Replies are listed 'Best First'.
Re: Re: executing a OSP with CGI
by chuleto1 (Beadle) on Jul 15, 2003 at 19:31 UTC
    Thanks for the input. I thougt $sth-execute() was used solely on Select statements
Re: Re: executing a OSP with CGI
by cjcollier (Novice) on Jul 15, 2003 at 21:24 UTC
    You might consider initializing your $dbh thus:
    $dbh = DBI->connect($dsn, $db_user, $db_pass, { RaiseError => 1 } ) or croak "Couldn't connect to database";
    The RaiseError argument will allow you to avoid the
    or die $dbh->errstr
    on each of your database actions.



Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2023-06-08 01:57 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (29 votes). Check out past polls.