Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: DBI problem on AIX/Oracle 10g

by fmerges (Chaplain)
on Jul 24, 2007 at 17:45 UTC ( [id://628536]=note: print w/replies, xml ) Need Help??


in reply to DBI problem on AIX/Oracle 10g

Hi,

Why is the scope of the $sth (statement handler) outside of the function, and the $ltqs_dbh (database handler) scope only defined in the function itself? Why are you connecting and disconnecting everytime you call the function?

Regards,

fmerges at irc.freenode.net

Replies are listed 'Best First'.
Re^2: DBI problem on AIX/Oracle 10g
by hibbarra (Novice) on Jul 24, 2007 at 18:01 UTC
    $sth is a persistent variable. That way I can use it in the unless statement. The connect to the database uses its own persistent variable if its already defined it just returns it if its not it performs a connect. I am not disconecting and reconnecting, I only connect once. By doing it this way I don't have to pass connection handles all over the place. Hibbarra

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2025-03-25 22:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (67 votes). Check out past polls.

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.