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