Friday, March 5, 2010

ORA-06553: PLS-306: wrong number or types of arguments in call to 'OGC_X'

Can't figure out why your SELECT statement is throwing 'OGC_X' error ?

1) Most probably, your SELECT has a table with an alias "x"
2) Your oracle is version is lower than 11g
3) You probably mistyped column name

Solution
Prior to Oracle 11g, Oracle by default comes with a synonym 'X' defined for "OGC_X".

1) In your SELECT, if you mistype the column name from the table aliased as "x", Oracle tries to use the Synonym object "OGC_X", and hence you get the error.

Following SQL works
select * from dual x where x.dummy = 'X'

Now change, x.dummy to x.fummy (wrong column name), you will the error

select * from dual x where x.fummy = 'X'

In summary, if your table alias matches any synonym in your database and you typed the column name of the aliased table wrong, you get the error "ORA-06553: PLS-306: wrong number or types of arguments in call to ..."

1 comment: