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

As it is DBD::Oracle returns rather non-helpful error messages that don't include line number info, etc. With SQL*Plus you get the line number, and a pointer to exactly where the parser failed. Is there any way to get this same functionality with DBD::Oracle? Like is there some function I can call to get that info from oracle.

Thanks,
Nathan Shafer
Nicodemus

Replies are listed 'Best First'.
(Ovid) Re: Better DBD::Oracle error messages
by Ovid (Cardinal) on Mar 12, 2001 at 22:29 UTC
    Acting on the assumption that you are using DBI with DBD::Oracle, you may want to look at the DBI->trace function. You can find fairly complete info at this link. This can provide you with a wealth of information. See "Programming the Perl DBI" by O'Reilly for more information.

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Re: Better DBD::Oracle error messages
by arturo (Vicar) on Mar 12, 2001 at 22:28 UTC

    One thing you can do is check out the trace method in the DBI doccumentation; that won't help much with those nasty ORA-3.837613847631E08 type error messages much, though. I still have to keep a copy of the Oracle documentation handy (try technet.oracle.com if you don't have a local copy).

    If there are even better ways, I'd like to hear them too.

    HTH

    Philosophy can be made out of anything. Or less -- Jerry A. Fodor

      On *nix machines oracle provides the command line oerr utility. It can be very handy. Usage is simple, just give it your error code and it gives you (somewhat) more info:
      $ oerr ora 12450
      12450, 00000, "LOB datatype disabled in LBAC initialization file"
      // *Cause:  You tried to specify a LOB datatype for a column or attribute,
      //          but the use of the LOB datatype has been disabled.
      // *Action: Change the LBAC initialization file to allow the creation
      //          of LOB columns and attributes.