Friday, February 02, 2007

DBMS_XMLSCHEMA.GENERATESCHEMA and ORA-21500

You may run into this error. You want to generate an xsd based on on object type. You create the object:

CREATE OR REPLACE TYPE my_test_type
AS OBJECT (
EMPLOYEE_ID NUMBER(6),
FIRST_NAME VARCHAR2(20)
);


Then you want to get the associated xsd:

SQL> Set pagesize 9999
SQL> Set linesize 132
SQL> Set long 9999
SQL>
SQL> select DBMS_XMLSCHEMA.GENERATESCHEMA( 'APPS', 'MY_TEST_TYPE')
2 from dual
3 /


Instead of getting the xsd, you get the following:

ERROR:
ORA-21500: internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]


The problem is not at the database, but with sql*plus. You are probably using a 9i sqlplus client. Try a 10g sqlplus and it should work fine.

As always, if this helps, drop me a comment. It would be great to know that this actually helped someone.

1 comment:

Anonymous said...

Exactly as you said. Cheers.