Home > OS >  Oracle: Create schema with table of xml type
Oracle: Create schema with table of xml type

Time:10-30

in the Oracle database I wanted to create a schema with a table of XMLTYPE.

CREATE SCHEMA AUTHORIZATION xmlAdmin
    CREATE TABLE PossibleAnswers OF XMLTYPE;

In return, I get an error of ORA-00906: missing left parenthesis.

Is there any reason why this is not working?

CodePudding user response:

This is what you tried; it won't work:

SQL> create schema authorization scott
  2    create table a of xmltype;
  create table a of xmltype
                 *
ERROR at line 2:
ORA-00906: missing left parenthesis

Though, you can create such a table itself:

SQL>   create table a of xmltype;

Table created.

If you want to create a schema and a table, modify create table statement to e.g.

SQL> create schema authorization scott
  2    create table b (col xmltype);

Schema created.

SQL>

CodePudding user response:

You want to create the schema with a table with a column of type XMLTYPE rather than trying to create an object-derived table from XMLTYPE:

CREATE SCHEMA AUTHORIZATION xmlAdmin
  CREATE TABLE PossibleAnswers (value XMLTYPE);
  • Related