Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: executing a OSP with CGI

by blue_cowdawg (Monsignor)
on Jul 15, 2003 at 19:24 UTC ( [id://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
Peter@Berghold.Netwww.berghold.net
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.

    Namaste

    C.J.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-16 09:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found