ORA-06552: PL/SQL: Compilation Unit Analysis Terminated

Today I received a strange error from Oracle, for what appeared to be no good reason:

  1. ORA-06552: PL/SQL: Compilation unit analysis terminated
  2. ORA-06553: PLS-320: The declaration of the type of this expression is incomplete or malformed

I received the error when attempting to create a trigger on a newly created table. I could create triggers on other tables without any errors, however on the new table – it would error every time.

The table definition included a column named timestamp with the data type timestamp. Oracle was happy enough for me to create the table, however it refused to let me create a trigger on the table with a column name over lapping a reserved word.

The solution was simple, renamed the column in question to use a non-reserved word and everything continued as normal. I must say though, I think it is strange that it would let me create the table using the reserved word in the first place if it was going to complain about me using other standard Oracle features which would error as a by product of the reserved word.

Related posts:

  1. ASP Error ’0×80004005′
  2. PostgreSQL Dynamic SQL & Quote_ident Gotchas
  3. Oracle Derived Columns In SELECT Statements
  4. ORA-06502: PL/SQL: numeric or value error
  5. Storing Time Information In Oracle

About Al

My name is Alistair Lattimore, I'm in my very early 30's and live on the sunny Gold Coast in Australia. I married my high school sweet heart & we've been together for longer than I can remember. Claire and I started our family in September 2008 when Hugo was born and added a gorgeous little girl named Evie in May 2010. You can find me online in the typical hangouts, Google, Twitter & facebook. .
This entry was posted in Database, Programming. Bookmark the permalink.

6 Responses to ORA-06552: PL/SQL: Compilation Unit Analysis Terminated

  1. Jacob says:

    serves you right for using a reserved word for your column :P *rssssp*

  2. Brendan says:

    Maybe I’m wrong but I thought that you are able to use reserved words. You just have to use escape chars when accessing them eg [DATETIME] in sqlserver, or `SOMERESERVEDWORD` in mysql…

  3. jacob says:

    a quick google gives us this lovely snippet which tells us that all oracle reserved words can be used as column and table names when wrapped in double quotes. The only exception to this rule is the ROWID reserved word.

  4. Al says:

    Jake,

    It isn’t a matter of Oracle not allowing the reserved word as a column name, it allows timestamp as a column name just fine.

    The issue is that if you use a reserved word as a column name, it breaks some of the other standard Oracle features such as triggers.

    Even if you enclose the column timestamp in double quotes while creating the table – you will still receive the error I outlined above when you try to create a trigger on the table; hence my confusion.

    Al.

  5. James says:

    Thanks! I run into the same problem. I called one of the columns “date” :(

  6. Morten K says:

    Just had the same problem;

    For anyone googling their way here, the problem surfaces when you have a column of the _type_ timestamp in the same table as a column with the _name_ timestamp. Change either and it works fine.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>