Nalina has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks
In our application we are using oraperl to aceess oracle. ora_login function is being called many times. I tried to print the return value of this function each time it is called. It looks something like this.
DBI::db=HASH(0x4034ddc8) DBI::db=HASH(0x4034ddc8) DBI::db=HASH(0x4034ddc8) DBI::db=HASH(0x4034ddc8) DBI::db=HASH(0x4034ddc8) DBI::db=HASH(0x40239258)
The last return value is different from previous values. And also data fetched in this last instance(i.e. when the return value is DBI::db=HASH(0x40239258)) is not the data in the database.
What could be the problem?
Thanks in advance

Replies are listed 'Best First'.
Re: Problem with ora_login function in oraperl
by holli (Abbot) on May 04, 2006 at 07:37 UTC
    oraperl is old and deprecated. If this is for a new project you should have a look at DBI and DBD::Oracle.


    holli, /regexed monk/
Re: Problem with ora_login function in oraperl
by perl_lover (Chaplain) on May 04, 2006 at 07:18 UTC
    The Result you are getting is a hash ref. So Use Dumper method of Data::Dumper instead of print to see what the hash contains.
Re: Problem with ora_login function in oraperl
by graff (Chancellor) on May 05, 2006 at 04:28 UTC
    My first guess would be that the connection parameters are different for that last call to ora_login, and you are connecting to some different database (which somehow happens to have the same table schema as the database used in the first several calls).

    Maybe you have "development" and "production" versions of the database (or "legacy" and "current" servers)? And maybe the script originally used one of them, then was edited to use the other -- but one of the login calls was missed by the edit?

    You should have the connection parameters specified once for the whole application, perhaps in a separate module, so that if you need to change anything (host name, password, etc), you only need to update one data structure in one piece of code.