// Oracle error reference

ORA-06512: at line (PL/SQL error stack)

Not an error by itself: a line in the error stack showing which PL/SQL unit and line raised or passed on the real error listed above it.

Error code
ORA-06512
Category
PL/SQL
Error message
at string line string

What it means

ORA-06512 entries form a backtrace: ORA-06512: at "APP.BILLING_PKG", line 42. The first error in the stack (above the ORA-06512 lines) is the real problem; each ORA-06512 shows a PL/SQL unit and line it passed through, innermost first.

The full 19c message is at string line string.

Common causes

  • Any unhandled error inside PL/SQL, such as ORA-01403, ORA-06502 or a RAISE_APPLICATION_ERROR.

How to fix it

  1. Fix the first error in the stack. Open the unit and line named by the first ORA-06512 to see where it was raised.

    SELECT line, text FROM all_source
    WHERE owner = 'APP' AND name = 'BILLING_PKG' AND type = 'PACKAGE BODY'
    AND line BETWEEN 35 AND 45;
  2. When you log errors in exception handlers, include DBMS_UTILITY.FORMAT_ERROR_BACKTRACE so the line numbers aren't lost.

    EXCEPTION
      WHEN OTHERS THEN
        log_error(SQLERRM || ' ' || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
        RAISE;

Related errors

More pl/sql errors

The code and message text are from the Oracle Database Error Help. Browse the full Oracle error list or search every database error.

// fewer errors, faster fixes

Work on Oracle in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for Oracle and the other databases you use.