Registering XML schema in XE 10g [message #172486] |
Tue, 16 May 2006 17:18 |
oliversalmon
Messages: 5 Registered: March 2006
|
Junior Member |
|
|
Hi,
I'm having trouble registering an XML schema in XE 10gR2. I wish Oracle to create the object tables for me after the schema is registered and am registering a schema held in a clob. Below is a sample of my code.
PROCEDURE register_schema(p_schema CLOB) IS
BEGIN
DBMS_XMLSCHEMA.REGISTERSCHEMA('testschema.xsd',p_schema,owner => 'EMG');
END register_schema;
This is called by an anonymous block:
DECLARE
my_schema CLOB := NULL;
BEGIN
SELECT s.x_schema
INTO my_schema
FROM schema_table s
WHERE s.schema_id = 1;
xml_manager.register_schema(my_schema);
END;
When I run it, I get the following error message:
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "XDB.DBMS_XDBZ0", line 275
ORA-06512: at "XDB.DBMS_XDBZ", line 7
ORA-06512: at line 1
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 20
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 31
ORA-06512: at "EMG.XML_MANAGER", line 16
ORA-06512: at line 8
I understand what the message means, but am not sure how to work around it. It seems ludicrous that I would have to grant execute on all the packages used by xdb to use it's functions in a user schema. Have I got something fundametally wrong here? Should I be running this code as xdb?
Thanks in advance for your help.
Oliver
|
|
|
Re: Registering XML schema in XE 10g [message #267600 is a reply to message #172486] |
Thu, 13 September 2007 17:46 |
darrellhayward
Messages: 1 Registered: September 2007
|
Junior Member |
|
|
Well, I tried granting execute privileges on the packages to my XMLDB user and that didn't work.
So I just logged in as SYS and executed the procedures and it worked like a charm.
It even created the tables and object types in the DEV schema.
|
|
|
|
|