ORA-06550 line N column N Solution

Are you getting the ORA-06550 error when running an SQL statement? Learn the cause of this error and the solution in this article.

Demonstration of the Error

To demonstrate this error, I can run this code that creates a stored procedure:

1CREATE OR REPLACE PROCEDURE testProcedure AS
2  textValue VARCHAR2(3);
3BEGIN
4  textValue := someOtherValue;
5END;

If I compile this procedure, I get this message:

1Procedure TESTPROCEDURE compiled
2Errors: check compiler log

Now, I can run this procedure:

1EXEC testProcedure;
 1Error starting at line : 8 in command -
 2EXEC testProcedure
 3Error report -
 4ORA-06550: line 1, column 7:
 5PLS-00905: object INTRO_USER.TESTPROCEDURE is invalid
 6ORA-06550: line 1, column 7:
 7PL/SQL: Statement ignored
 806550. 00000 -  "line %s, column %s:\n%s"
 9*Cause:    Usually a PL/SQL compilation error.
10*Action:

As you can see, I get the error code ORA-06550: line X column X.

What caused this error?

ORA-06550 Cause

ORA-06550 is caused by a PL/SQL compilation error - an error in your PL/SQL code.

The cause of the error is actually dependent on the error it is linked to.

It's a bit of a decoy. It says "Hey, I've found an error, but your actual error is over there!"

As you might notice, when you get an ORA-06550 error, it is accompanied by a second error message just below it.

You should be able to see this if you're running SQL Developer or Toad (or many other IDEs).

Go to View > Log, and a Log window should appear.

ORA-06550 line N column N Solution

If not, you can run the SHOW ERRORS command.

1SHOW ERRORS;
1Errors for PROCEDURE INTRO_USER.TESTPROCEDURE:
2LINE/COL ERROR
3-------- -------------------------------------------------------
44/3      PL/SQL: Statement ignored
54/16     PLS-00201: identifier 'SOMEOTHERVALUE' must be declared

This will show the error message that causes this error to appear, which could be one of many errors.

ORA-06550 Solution

To resolve the ORA-06550 error, first fix the error that comes with it.

The error that comes with it is also more descriptive of the actual issue.

For example, in our example above, I also got a PLS-00201 error.

This was because I had mentioned a variable called someOtherValue but this was not declared anywhere.

To fix this, I would need to declare the variable, correct a typo if I spelt it wrong, or use another value.

Once you have fixed the error, recompile the code.

For example:

1CREATE OR REPLACE PROCEDURE testProcedure AS
2  textValue VARCHAR2(3);
3BEGIN
4  textValue := 'ABC';
5END;
1Procedure TESTPROCEDURE compiled
1EXEC testProcedure;
1PL/SQL procedure successfully completed.

Hopefully this article has helped you resolve the ORA-06550 error message.

comments powered by Disqus