Re: pl/sql with Oracle 7

From: C.J.Jardine <cj10_at_ucs.cam.ac.uk>
Date: Wed, 1 Jun 1994 10:15:33
Message-ID: <cj10.14.000A42A8_at_ucs.cam.ac.uk>


In article <2s3d8l$glh_at_master.di.fc.ul.pt> roque_at_master.di.fc.ul.pt writes:

> I've been trying to use sql*plus but the errors I find
> by "select * from USER_ERRORS", after compiling are
> meaningless .

I find the following oraperl script useful for displaying SQL compilation errors:

#!/usr/bin/oraperl
die ("You should use oraperl, not perl\n") unless defined &ora_login;

$lda = &ora_login($ENV{ORACLE_SID}, $ENV{ORACLE_USER}, $ENV{ORACLE_PW})

        || die $ora_errstr, "\n";
$csr = &ora_open($lda,
 "SELECT s.text, TO_CHAR(s.line, '9999MI'), s.name, s.type, " .

   "LPAD('!', e.position), e.text FROM user_source s, user_errors e " .
   "WHERE s.name = e.name AND s.type = e.type AND s.line = e.line " .
   "ORDER BY s.name, s.type, e.sequence")
        || die $ora_errstr, "\n";

while (($text, $line, $name, $type, $pos, $msg) = &ora_fetch($csr)) { unless ( ($type eq $oldtype) && ($name eq $oldname) )   { print "\n$type $name:\n";

     ($oldtype, $oldname) = ($type, $name); };
  print "$line$text     $pos\n$msg\n";

};
die $ora_errstr, "\n" if $ora_errno;

do ora_close($csr) || die $ora_errstr, "\n"; do ora_logoff($lda) || die $ora_errstr, "\n"; Received on Wed Jun 01 1994 - 10:15:33 CEST

Original text of this message