in reply to Re: Perl script not running correct as a cron
in thread Perl script not running correct as a cron

Thanks for the reply. I was also thinking about a environment variable. The Oracle server does not require username/pass and is open. If the username/pass was not working i should not get data at all, but i do get some. Only weird values... (in the status column.. the Well is 100% ok)
  • Comment on Re^2: Perl script not running correct as a cron

Replies are listed 'Best First'.
Re^3: Perl script not running correct as a cron
by JavaFan (Canon) on Jun 05, 2009 at 09:48 UTC
    Have you determined where it goes wrong? Is Oracle returning "weird" values? Or is MySQL inserting "weird" values? What happens if you trace the DBI?
      I have run this script in cron and outputted the data to a text file. Oracle is outputting the data correctly (print $status, $well) And i did a print $_1 on the Mysql sub and that also outputs it correct. I have no idea where it is going wrong..
        Any warnings/errors from MySQL? I see you don't check return values or check for errors. I always wrap my database actions in an eval block, and set RaiseError to 1 and AutoCommit to 0, with a commit at the end (and a roll back if the eval fails).

        I also note that for each row returned from Oracle you start a new MySQL connection. While this has nothing to do with your problem, it's quite costly (setting up a database connection is relatively expensive) if Oracle returns many rows.