PL/SQL & ORA-06512

From: JEFF CHAMBLEE <chamblej_at_author.gsfc.nasa.gov>
Date: 16 Nov 1993 10:36 -0500
Message-ID: <16NOV199310364835_at_author.gsfc.nasa.gov>


Hello folks,

I'm getting an ORA-6512 error, and it's driving me nuts. I'm trying to run the following through SQLPLUS. This code works on one of my database instances and not on another.


/*

   This script will create octal2decimal() in the database and use    it to convert all rows in MEMORY_MAP to decimal. */
CREATE or REPLACE FUNCTION octal2decimal (oct NUMBER) RETURN NUMBER AS

   tsoct NUMBER(8);
   tsdec NUMBER(8);
   x     NUMBER(8);

BEGIN
   tsoct := NVL(oct,0);
   tsdec := 0;
   x     := 1;
   WHILE tsoct > 0 LOOP
      tsdec := MOD(tsoct,10)*x + tsdec;
      tsoct := TRUNC(tsoct/10);
      x := x*8;

   END LOOP;
   RETURN tsdec;
END;
/

/* Convert all START_ADDRESS & END_ADDRESS in MEMORY_MAP to decimal. */

DECLARE
   CURSOR c1 IS select symbol, start_address, end_address    from memory_map;
BEGIN
   FOR sym_rec IN c1 LOOP

      sym_rec.start_address := to_char(octal2decimal
	(to_number(sym_rec.start_address)),'99999');
      sym_rec.end_address   := to_char(octal2decimal
	(to_number(sym_rec.end_address)),'99999');
      update memory_map 
         set start_address = sym_rec.start_address,
             end_address = sym_rec.end_address
         where symbol = sym_rec.symbol;

   END LOOP;
   CLOSE C1;
END;
/

/* Display first 10 results */

   select symbol, start_address, end_address

      from memory_map 
      where rownum <= 10
      order by symbol;

***********************************************************************
When I run it I get:

   CURSOR C2 IS select symbol, start_address, end_address

                              *

ERROR at line 2:
ORA-00942: table or view does not exist
ORA-06512: at line 10

I believe ORA-00942 is a totally bogus error. Line 10 is "update memory_map"


OBCDUSR1:[CHAMBLEJ.SQL]>oerr 6512
// *Action: Close cursor first before reopening.
06512, 00000, "at %sline %s"
// *Cause: Backtrace message as the stack is unwound by unhandled
// exceptions.
// *Action: Fix the problem causing the exception or write an exception
// handler for this condition. Or you may need to contact your
// application administrator or DBA.

I am the application administrator and DBA. :-(

I'm running VMS 5-5.2, ORACLE 7.0.12, PL/SQL 2.0.14


Jeff Chamblee			 "I am but mad north-north-west.  When the wind
Computer Sciences Corp. 	 is southerly, I know a hawk from a handsaw."
Laurel, MD 20707 USA 		  --Hamlet

CHAMBLEJ_at_AUTHOR.GSFC.NASA.GOV Received on Tue Nov 16 1993 - 16:36:20 CET

Original text of this message