Home » Developer & Programmer » JDeveloper, Java & XML » Registering XML schema in XE 10g  () 1 Vote
Registering XML schema in XE 10g [message #172486] Tue, 16 May 2006 17:18 Go to next message
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 Go to previous messageGo to next message
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.

Re: Registering XML schema in XE 10g [message #267704 is a reply to message #267600] Fri, 14 September 2007 05:49 Go to previous messageGo to next message
oliversalmon
Messages: 5
Registered: March 2006
Junior Member
Thanks for your help, I ended up doing the same thing, it still seems as though there should be a more sensible way to do it though.
Re: Registering XML schema in XE 10g [message #290391 is a reply to message #267704] Fri, 28 December 2007 12:21 Go to previous message
peterl
Messages: 12
Registered: September 2007
Junior Member
Grant the user the 'alter session' privilege.
Previous Topic: extract data
Next Topic: XMLSequence and attribute condition
Goto Forum:
  


Current Time: Tue Apr 23 06:40:49 CDT 2024