[COMPLEX DATATYPE] - Cannot create table

Hello
I tried to create a table with a column based on an complex data type from an Xml Schema.
1 -- XML Schema
<?xml version="1.0" encoding="UTF-8"?>
<!--W3C Schema generated by XMLSpy v2007 sp2 (http://www.altova.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
     <xs:element name="eventlog">
          <xs:complexType>
               <xs:sequence>
                    <xs:element ref="event" maxOccurs="unbounded"/>
               </xs:sequence>
               <xs:attribute name="lastupdate" use="required">
                    <xs:simpleType>
                         <xs:restriction base="xs:string">
                              <xs:enumeration value="12/05/2007 10:24:00"/>
                         </xs:restriction>
                    </xs:simpleType>
               </xs:attribute>
          </xs:complexType>
     </xs:element>
     <xs:element name="event">
          <xs:complexType>
               <xs:simpleContent>
                    <xs:extension base="xs:string">
                         <xs:attribute name="level" use="required">
                              <xs:simpleType>
                                   <xs:restriction base="xs:string">
                                        <xs:enumeration value="ERROR"/>
                                        <xs:enumeration value="WARNING"/>
                                   </xs:restriction>
                              </xs:simpleType>
                         </xs:attribute>
                         <xs:attribute name="date" use="required">
                              <xs:simpleType>
                                   <xs:restriction base="xs:string">
                                        <xs:enumeration value="12/05/2007 10:24:01"/>
                                   </xs:restriction>
                              </xs:simpleType>
                         </xs:attribute>
                    </xs:extension>
               </xs:simpleContent>
          </xs:complexType>
     </xs:element>
</xs:schema>
I've registred schema and create associated type with EM (Enterprise Manager)... OK.
when i create a table with Oracle SQL Developper ; i get an error 000902 - Invalide DATATYPE
DDL generated
CREATE TABLE TABLE1
COLUMN1 JACQUES.event1461_T
what's wrong ??
SQL> select * from v$version ;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL>
thanks for ur help.
Message was edited by:
user574414

Is this what you are looking to achieve...
SQL> set echo on
SQL> spool testcase.log
SQL> --
SQL> connect sys/ as sysdba
Enter password:
Connected.
SQL> set define on
SQL> set timing on
SQL> --
SQL> define USERNAME = XDBTEST
SQL> --
SQL> def PASSWORD = XDBTEST
SQL> --
SQL> def USER_TABLESPACE = USERS
SQL> --
SQL> def TEMP_TABLESPACE = TEMP
SQL> --
SQL> drop user &USERNAME cascade
  2  /
old   1: drop user &USERNAME cascade
new   1: drop user XDBTEST cascade
User dropped.
Elapsed: 00:00:01.65
SQL> grant connect, resource to &USERNAME identified by &PASSWORD
  2  /
old   1: grant connect, resource to &USERNAME identified by &PASSWORD
new   1: grant connect, resource to XDBTEST identified by XDBTEST
Grant succeeded.
Elapsed: 00:00:00.03
SQL> grant create any directory, drop any directory to &USERNAME
  2  /
old   1: grant create any directory, drop any directory to &USERNAME
new   1: grant create any directory, drop any directory to XDBTEST
Grant succeeded.
Elapsed: 00:00:00.00
SQL> grant alter session, create view to &USERNAME
  2  /
old   1: grant alter session, create view to &USERNAME
new   1: grant alter session, create view to XDBTEST
Grant succeeded.
Elapsed: 00:00:00.01
SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
  2  /
old   1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
new   1: alter user XDBTEST default tablespace USERS temporary tablespace TEMP
User altered.
Elapsed: 00:00:00.00
SQL> connect &USERNAME/&PASSWORD
Connected.
SQL> --
SQL> alter session set events ='19027 trace name context forever, level 0x800'
  2  /
Session altered.
Elapsed: 00:00:00.00
SQL> var schemaURL varchar2(700)
SQL> var xmlschema clob
SQL> --
SQL> begin
  2    :schemaURL := 'http://xmlns.example.com/xsd/testcase.xsd';
  3    :xmlSchema :=
  4  '<?xml version="1.0" encoding="UTF-8"?>
  5  <!--W3C Schema generated by XMLSpy v2007 sp2 (http://www.altova.com)-->
  6  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xdb:storeVarrayAsTable="true">
  7     <xs:element name="eventlog" xdb:defaultTable="EVENT_LOG_TABLE" xdb:SQLType="EVENT_LOG_T">
  8             <xs:complexType>
  9                     <xs:sequence>
10                             <xs:element ref="event" maxOccurs="unbounded" xdb:SQLCollType="EVENT_V"/>
11                     </xs:sequence>
12                     <xs:attribute name="lastupdate" use="required">
13                             <xs:simpleType>
14                                     <xs:restriction base="xs:string">
15                                             <xs:enumeration value="12/05/2007 10:24:00"/>
16                                     </xs:restriction>
17                             </xs:simpleType>
18                     </xs:attribute>
19             </xs:complexType>
20     </xs:element>
21     <xs:element name="event" xdb:SQLType="EVENT_T">
22             <xs:complexType>
23                     <xs:simpleContent>
24                             <xs:extension base="xs:string">
25                                     <xs:attribute name="level" use="required">
26                                             <xs:simpleType>
27                                                     <xs:restriction base="xs:string">
28                                                             <xs:enumeration value="ERROR"/>
29                                                             <xs:enumeration value="WARNING"/>
30                                                     </xs:restriction>
31                                             </xs:simpleType>
32                                     </xs:attribute>
33                                     <xs:attribute name="date" use="required">
34                                             <xs:simpleType>
35                                                     <xs:restriction base="xs:string">
36                                                             <xs:enumeration value="12/05/2007 10:24:01"/>
37                                                     </xs:restriction>
38                                             </xs:simpleType>
39                                     </xs:attribute>
40                             </xs:extension>
41                     </xs:simpleContent>
42             </xs:complexType>
43     </xs:element>
44  </xs:schema>
45  ';
46  end;
47  /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
SQL> begin
  2    dbms_xmlschema.registerSchema
  3    (
  4        schemaURL => :schemaURL
  5       ,schemaDoc => :xmlschema
  6       ,local     => TRUE
  7       ,genBean   => false
  8       ,genTypes  => TRUE
  9       ,genTables => TRUE
10       ,enableHierarchy => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
11    );
12  end;
13  /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.62
SQL> desc EVENT_LOG_TABLE
Name                                      Null?    Type
TABLE of SYS.XMLTYPE(XMLSchema "http://xmlns.example.com/xsd/testcase.xsd" Element "eventlog") STORAGE Object-relational TYPE "EVENT_LOG_T"
SQL> --
SQL> create table RELATIONAL_TABLE
  2  (
  3    EVENT_XML XMLTYPE
  4  )
  5  XMLTYPE EVENT_XML
  6  STORE AS OBJECT RELATIONAL
  7  XMLSCHEMA "http://xmlns.example.com/xsd/testcase.xsd" ELEMENT "eventlog"
  8  VARRAY EVENT_XML."XMLDATA"."event" STORE AS TABLE EVENT_NT
  9  (
10     (PRIMARY KEY (NESTED_TABLE_ID, SYS_NC_ARRAY_INDEX$))
11     ORGANIZATION INDEX OVERFLOW
12  )
13  /
Table created.
Elapsed: 00:00:00.14
SQL> desc RELATIONAL_TABLE
Name                                      Null?    Type
EVENT_XML                                          SYS.XMLTYPE(XMLSchema "http:
                                                    //xmlns.example.com/xsd/test
                                                    case.xsd" Element "eventlog"
                                                    ) STORAGE Object-relational
                                                    TYPE "EVENT_LOG_T"
SQL>

Similar Messages

  • Can create view, but cannot create table / materialized view: Xpath is null

    Hi all,
    We recently moved some XML documents into the database in an XMLType column and want to query the data. I've been writing some queries and turning them into materialized views. I got to one query, and something really strange is happening. My query returns the expected results, but I am getting an error when I try to create a materialized view out of it. Even stranger, I can create a view out of it, and I can manually insert its data into an existing table, but I cannot create a materialized view out of it and I cannot create a table out of it. Here is a brief summary, please let me know if anyone has suggestions.
    Issuing the following commands fails in SQLDeveloper
    -- Creating a materialized view out of the query fails:
    create materialized view element REFRESH COMPLETE ON DEMAND as [query];
    Error at Command Line:1 Column:1 SQL Error: ORA-31063: XPath compilation failed: Xpath is null.
    -- Creating a table out of the query with the following shortcut fails:
    create table element as [query];
    Error at Command Line:1 Column:1 SQL Error: ORA-31063: XPath compilation failed: Xpath is null.
    Issuing the following commands in SQLDeveloper works fine:
    -- Creating a view out of the query works:
    create or replace view element as [query];
    -- Creating a blank table from the query and then inserting data works:
    create table element as select * from [query] where 1 = 2;
    insert into element select * from [query];
    Here is a simplified version of the query...
    I have changed the names around, and cut the query down so maybe it will be a little easier to understand. I did confirm that this query is also having the same symptoms described above. Since I changed the names, executing the query returns no results. However creating a materialized view out of the query still fails with the 'Xpath is null' error.
    create materialized view element REFRESH COMPLETE ON DEMAND as
    select
    m.resource_id,
    xml.*
    from metadata_sources m,
    xmltable(
    'for $i in /metadata/app//*[(self::elem1 or self::elem2) and (parent::form or parent::subform)]
    let $formName := if($i/parent::subform) then $i/../../@name else $i/../@name
    let $subformName := if($i/parent::subform) then $i/../@name else ""
    return <data
    appId="{$i/ancestor::app[1]/idField}"
    formName="{$formName}"
    subformName="{$subformName}"
    elemName="{$i/@name}"></data>' passing m.xml_content
    columns
    app_id NUMBER path '@appId',
    form_name VARCHAR2(50 char) path '@formName',
    subform_name VARCHAR2(50 char) path '@subformName',
    elem_name VARCHAR2(50 char) path '@elemName'
    ) xml;
    Edited by: user11949534 on Feb 22, 2013 1:55 PM

    As far as creating a structured index, I was under the impression that I would need to then register an XSD. No, you can use it without an XML schema.
    How about a regular relational view, with an underlying xml index?
    That way you also eliminate the need for an explicit refresh step as you would then be querying real-time data, as if it were relational data.
    For example :
    Connected to:
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
    SQL> create table tmp_xml of xmltype ;
    Table created.
    SQL> insert into tmp_xml values (
      2    xmlparse(document '<root><item id="1">ABC</item><item id="2">DEF</item></root>')
      3  ) ;
    1 row created.
    SQL> insert into tmp_xml values (
      2    xmlparse(document '<root><item id="3">GHI</item><item id="4">JKL</item></root>')
      3  ) ;
    1 row created.
    SQL> create or replace view tmp_xml_v as
      2  select x.item_id, x.item_val
      3  from tmp_xml
      4     , xmltable(
      5         '/root/item' passing object_value
      6         columns item_id  number      path '@id'
      7               , item_val varchar2(3) path '.'
      8       ) x
      9  ;
    View created.
    SQL> create index tmp_xml_sxi on tmp_xml (object_value)
      2  indextype is xdb.xmlindex
      3  parameters (q'#
      4  XMLTABLE tmp_xml_xtb '/root/item'
      5  COLUMNS item_id  number      path '@id'
      6        , item_val varchar2(3) path '.' #'
      7  ) ;
    Index created.
    SQL> exec dbms_stats.gather_table_stats(user, 'TMP_XML');
    PL/SQL procedure successfully completed.
    SQL> set autotrace on explain
    SQL> set lines 200
    SQL> select * from tmp_xml_v ;
       ITEM_ID ITE
             3 GHI
             4 JKL
             1 ABC
             2 DEF
    Execution Plan
    Plan hash value: 4168126828
    | Id  | Operation                    | Name                   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |                        |     4 |   164 |     3   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS                |                        |       |       |            |          |
    |   2 |   NESTED LOOPS               |                        |     4 |   164 |     3   (0)| 00:00:01 |
    |   3 |    INDEX FULL SCAN           | SYS_C009273            |     2 |    34 |     1   (0)| 00:00:01 |
    |*  4 |    INDEX RANGE SCAN          | SYS30366_30367_OID_IDX |     2 |       |     0   (0)| 00:00:01 |
    |   5 |   TABLE ACCESS BY INDEX ROWID| TMP_XML_XTB            |     2 |    48 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       4 - access("TMP_XML"."SYS_NC_OID$"="SYS_SXI_0"."OID")

  • ODCIIndexCreate cannot create table

    Hi everybody,
    I'm trying to implement the Power Demand Cartridge Example. So far everything is compiled fine, but if I want to use the index the "Create Index" fails because the "CREATE TABLE" cannot be executed. If I run the "CREATE TABLE" with sqlplus (as the cartridge owner) it works fine, but if I use Create Index (as the cartridge owner) it fails. What permissions are necessary? I granted connect and resource to the user :(
    Thanks!

    Don not underestimate the Power Of Oracle Docs ;-)
    It's all described here:
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10765/pwr_example.htm#i1005282
    Example 15-1 How to Create a Database User for the Power Demand Cartridge
    set echo on
    connect sys/knl_test7 as sysdba;
    drop user PowerCartUser cascade;
    create user PowerCartUser identified by PowerCartUser;
    -- INITIAL SET-UP
    -- grant privileges --
    grant connect, resource to PowerCartUser;
    grant create operator to PowerCartUser;
    grant create indextype to PowerCartUser;
    grant create table to PowerCartUser;

  • Need Help!!  Cannot Create Table

    Hi,
    I just installed Oracle XE and APEX 4.0.2. I REALLY need to create an application with 3 tables where I can update these tables via a form like found in Application Express. The install and configuration went very smoothly until I went to create an application built on my .csv files of the tables. When I try to add the table when building the application I get this error:
    ORA-20001: Unable to create modules. ORA-20001: create_table error: ORA-20001: Excel load run ddl error: ORA-01003: no statement parsed
    Can someone give me an idea how I can fix this error?
    Thanks so much for your help! It's greatly appreciated!!
    NS

    The user is system.Are you saying that the parsing schema for the application is the standard SYSTEM schema? This should not be possible, and is certainly not recommended. If this is somehow the case, create a new schema and use it instead.
    (Please update your forum profile with a better handle than "user649041".)

  • Create Table using DBMS_SQL package and size not exceeding 64K

    I have a size contraint that my SQL size should not exceed 64K.
    Now I would appriciate if some one could tell me how to create a table using
    Dynamic sql along with usage of DBMS_SQL package.
    Brief Scenario: Users at my site are not given permission to create table.
    I need to write a procedure which the users could use to create a table .ALso my SQL size should not exceed 64K. Once this Procedure is created using DBMS_SQL package ,user should pass the table name to create a table.
    Thanks/

    "If a user doesn't have permission to create a table then how do you expect they will be able to do this"
    Well, it depends on what you want to do. I could write a stored proc that creates a table in my schema and give some other user execute privilege on it. They would then be able to create a able in my schema without any explicitly granted create table privilege.
    Similarly, assuming I have CREATE ANY TABLE granted directly to me, I could write a stroe proc that would create a table in another users schema. As long as they have quota on their default tablespace, they do not need CREATE TABLE privileges.
    SQL> CREATE USER a IDENTIFIED BY a
      2  DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp;
    User created.
    SQL> GRANT CREATE SESSION TO a;
    Grant succeeded.
    SQL> CREATE TABLE a.t (id NUMBER, descr VARCHAR2(10));
    CREATE TABLE a.t (id NUMBER, descr VARCHAR2(10))
    ERROR at line 1:
    ORA-01950: no privileges on tablespace 'USERS'So, give them quota on the tablespace and try again
    SQL> ALTER USER a QUOTA UNLIMITED ON users;
    User altered.
    SQL> CREATE TABLE a.t (id NUMBER, descr VARCHAR2(10));
    Table created.Now lets see if it really belongs to a:
    SQL> connect a/a
    Connected.
    SQL> SELECT table_name FROM user_tables;
    TABLE_NAME
    T
    SQL> INSERT INTO t VALUES (1, 'One');
    1 row created.Yes, it definitely belongs to a. Just to show that ther is nothing up my sleeve:
    SQL> create table t1 (id NUMBER, descr VARCHAR2(10));
    create table t1 (id NUMBER, descr VARCHAR2(10))
    ERROR at line 1:
    ORA-01031: insufficient privilegesI can almost, but not quite, see a rationale for the second case if you want to enforce some sort of naming or location standards but the whole thing seems odd to me.
    Users cannot create tables, so lets give them a procedure to create tables?
    John

  • JPA - TroubleShooting - Error in Datatypes used in Creating Tables

    h1. JPA - TroubleShooting - Error in Datatypes used in Creating Tables
    h2. Error Description
    The error appears when JPA is trying to automatically
    generate tables from Entities. It uses types it shouldn't because they aren't
    supported by the Database Engine. If you examine the createDDL.jdbc file you
    are going to find not supported data types. You could run the statements that
    are listed there directly to your Database Engine and find out that they don`t
    run generating syntax errors like the error posted below.
    h3. Query example (statement)
    CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(50), SEQ_COUNT NUMBER(19))h3. PostgreSQL Error whent trying to execute the statment
    CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(50),
    SEQ_COUNT NUMBER(19))": org.postgresql.util.PSQLException: ERROR: syntax
    error near "("
    h3. MSSQL 2000 Error when trying to execute the statement:
    [CREATE - 0 row(s), 0.578 secs] [Error Code: 2715, SQL State: HY000] [Microsoft][SQLServer 2000 Driver for
    JDBC][SQLServer]Column or parameter #1: Cannot find data type NUMBER
    h3. FireBird Error when trying to execute the statment
    Dynamic SQL Error
    SQL error code = -104
    Token unknown - line 1, char 62
    Statement: CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(50),
    SEQ_COUNT NUMBER(19))
    h2. TroubleShooting
    Looks like it wants "NUMERIC", not "NUMBER".
    [http://www.postgresql.org/docs/8.1/interactive/datatype.html#DATATYPE-NUMERIC]
    I had this problem using Firebird. I found out it had to do
    with the database jdbc driver. I tried using a different database engine, like
    Microsoft SQL Server 2000 with the corresponding driver and it worked as it
    should. I suspect the JDBC driver has to supply in some way the datatypes it
    supports to JPA TopLink Library.
    Edited by: juanemc2 on Apr 1, 2008 7:39 AM

    In Hibernate you can supply the "dialect" to use for SQL generation. I assume TopLink to have a similar functionality.
    This is not a generic JPA issue, but rather something with the specific implementation you're using.
    Or rather it is a generic SQL issue, caused by different database engines using slightly (or not so slightly) different SQL syntax which causes problems when generating SQL automatically.

  • ORA-12015: cannot create a fast refresh materialized view from a complex qu

    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - ProductionI'm trying to create a fast refresh materialized view that uses a column of xmltype. The problem is I cannot create an MV log that accounts for the xmltype column. I tried excluding it and got the above error. Is there another way I can incrementally update a materialized view where I don't have to do a COMPLETE refresh or use FAST refresh?
    CREATE TABLE "DAS_DESC"."AUTHORITY_TEST"
        "NAID"      NUMBER(20,0) NOT NULL ENABLE,
        "AUTH_TYPE" VARCHAR2(40 BYTE),
        "XML_DATA" "SYS"."XMLTYPE" ,
        "TERM_NAME" VARCHAR2(4000 BYTE)
    CREATE TABLE "DAS_DESC"."AUTH_ASSC_TEST"
        "NAID"    NUMBER(20,0),
        "P_NAID" NUMBER(20,0),
        "REL_TYPE"    VARCHAR2(25 BYTE),
        "XML_DATA" "SYS"."XMLTYPE"
    CREATE
    MATERIALIZED VIEW person_mv
    AS
    SELECT  p.naid
          , p.auth_type
          , INSERTCHILDXML
              p.xml_data                 -- Parent XML Column
            , '//*[contains(local-name(), ''person'')]' --XPATH to Person
            , 'nonPreferredHeadingArray'                -- Value for new child element
            (                                                       -- Sub query for injecting new variant person array
              SELECT XMLELEMENT
                "nonPreferredHeadingArray"
              , XMLAGG -- Aggregator for Variant Persons Array
                  XMLELEMENT
                    "variantPersonName"                    -- Wrapper for each entry in array
                  , extract(a.xml_data,'*/*')
              FROM auth_assc_table -- Link table
              WHERE a.p_naid = p.naid
          ) AS XML_DATA
    FROM authority p -- Parent table
    WHERE p.auth_type = 'Person';The views are created fine and they work perfectly for what we need. The problem is the refresh when we edit the base tables. Ideally, it should take a couple seconds. Right now, it takes a couple minutes. XMLTYPE is one problem and the Complex Query exception is the other. If there is a work-around for fast refresh, please let me know. Greatly appreciated.

    jjmdb wrote:
    I'm trying to create a fast refresh materialized view that uses a column of xmltype. The problem is I cannot create an MV log that accounts for the xmltype column. I tried excluding it and got the above error. Is there another way I can incrementally update a materialized view where I don't have to do a COMPLETE refresh or use FAST refresh? Besides XMLTYPE column, your MV definition has a subquery which prevents it from being fast refreshable.
    I could not find any specific reference in documentation about restriction on XMLTYPE (or CLOB) columns but it seems logical that oracle will not be able to keep track of changes to binary data. What does DBMS_MVIEW.EXPLAIN_MVIEW generate for your MV definition? That should tell you which all conditions (for FAST REFRESH) your MV violates. Since you can not create a MV LOG to include XMLTYPE column, it will not be possible to create a FAST REFRESHABLE MV that includes the XMLTYPE column.
    I am afraid there is not much you can do here unless you are prepared to change the way data is stored in your base tables. If you can store data in base tables using standard data types instead of binary/XML storage, you might be able to create a FAST REFRESHABLE MV.

  • Database Adapter: cannot access table with complex record type as columns

    Hi all,
    I cannot perform any operations on a table that has columns with complex record type.
    I have created a table to store purchase order details.
    Sample script:
    CREATE type XX_CUST_INFO_TYP as object
    ssn VARCHAR2(20),
    rating NUMBER(15)
    CREATE type XX_ITEM_TYP as object
    item_name VARCHAR2(20),
    unit_price NUMBER(15),
    quantity NUMBER(15)
    CREATE table XX_PORDER (cust XX_CUST_INFO_TYP, porder XX_ITEM_TYP);
    When i try to access the table X_PORDER in jdev through a database Adapter, i receive the error as
    "some tables contains columns that are not recognized by the database adpter"
    1.) so in this case, how to include such tables that have complex types?
    Also, check out this scenario also..
    1. add a table through a database adapter
    2. drop the table in backend
    3. i can still see the table and its structure in the database adapter wizard even after restarting Jdeveloper.. How is it possible?
    These are some really interesting scenarios to experiment. Please suggest your ideas on this..
    Thanks All!

    Hi Hem,
    for a select you could select against a view. And for inserts you could create a stored procedure. They support complex types since 10.1.2. Complex types support in tables/views was added for 11 (next major release).
    You might be able to use PureSQL as a workaround too, i.e.
    insert into XX_PORDER values (XX_CUST_INFO_TYP(?,?), XX_ITEM_TYP(?, ?, ?))
    As for your other problem, in 10.1.2/10.1.3 the DBAdapter wizard sits on top of the Jdev Offline Tables and TopLink Mapping Workbench components. When you remove a table in the wizard it won't delete the Offline DB component. It was added by the wizard, but afterwards it is public to the entire Jdev project. You must remove it from Jdev yourself. This has been improved for the next major release too, no artifacts from underlying components are created.
    To remove it select:
    Offline DB Objects -> <schema> -> <table> and try File.. Erase From Disk.
    Thanks
    Steve

  • ORA-12015:  cannot create a fast refresh materialized view from a complex q

    Hi,
    I'm facing very strange problem. Please help me why this error is coming
    I'm creating a simple materialized view, but it is giving below error since this is simple select * from.
    CREATE MATERIALIZED VIEW EFMS.MS_TASK
    BUILD IMMEDIATE
    REFRESH FAST
    START WITH SYSDATE
    NEXT (SYSDATE + 1/24)
    WITH ROWID
    AS
    SELECT * FROM MS_TASK@efms_link;
    SELECT * FROM MS_TASK@efms_link
    ERROR at line 8:
    ORA-12015: cannot create a fast refresh materialized view from a complex query
    CREATE MATERIALIZED VIEW LOG ON MSDBO.MS_TASK
    TABLESPACE DBOR_MVLOG
    PCTUSED 0
    PCTFREE 60
    INITRANS 20
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOCACHE
    NOLOGGING
    PARALLEL ( DEGREE 2 INSTANCES 1 )
    WITH ROWID, PRIMARY KEY
    EXCLUDING NEW VALUES;


    Not is a best practice to use 'select *'

    ORA-12015: cannot create a fast refresh materialized view from a complex query
    Cause:      Neither ROWIDs and nor primary key constraints are supported for complex queries.
    Action:      Reissue the command with the REFRESH FORCE or REFRESH COMPLETE option or create a simple materialized view.
    Then you have to change REFRESH FAST or create a primary key in MS_TASK@efms_link to avility fast refresh.
    . :-) any help with my english is wellcome :-) .

  • ORA-12015: cannot create a fast refresh materialized view from a complex

    Hi All,
    I am trying to create materialized view but i got a error ORA-12015: cannot create a fast refresh materialized view from a complex query.
    Regards,
    narayana

    Hi,
    Please see if (Note: 179466.1 - Diagnosing ORA-12015 fast refresh materialized view / complex queries) helps.
    Regards,
    Hussein

  • Cannot create temporary table having identity column

    Hi experts,
    I saw the above error msg while running the following statement:
           create local temporary column table #tmp_table (c1 int GENERATED by default AS IDENTITY (start with 1 increment by 1), c2 int)
         Could not execute 'create local temporary column table #tmp_table(c1 int GENERATED by default AS IDENTITY (start with ...'
         SAP DBTech JDBC: [7]: feature not supported: cannot create temporary table having identity column: C1: line 1 col 48 (at pos 47)
    I understand we can support normal column table creation with identity column, but don't know why cannot support temporary column tables with identity column. Is there any configuration that can enable it for temporary column table? Or what can I do to support it indirectly, like writing a trigger to support it or something else?
    If not, then is there any future plan for this feature?
    Regards,
    Hubery

    Hi Hubery,
    I've heard this trail of arguments before...
    Customer has a solution... they want it on HANA... but they don't want to change the solution.
    Well, fair call, I'd say.
    The problem here is: there's a mix-up of solution and implementation here.
    It should be clear now, that changing DBMS systems (in any direction) will require some effort in changing the implementation. Every DBMS works a bit different than the others, given "standard" SQL or not.
    So I don't agree with the notion of "we cannot change the implementation".
    In fact, you will have to change the implementation anyhow.
    Rather than imitating the existing solution implementation on ASE, implement it on SAP HANA.
    Filling up tons of temporary tables is not a great idea in SAP HANA - you would rather try to create calculation views that present the data ad hoc in the desired way.
    That's my 2 cts on that.
    - Lars

  • Creating Complex Datatypes in Application Module Service Interface

    HI All,
    I need to create the complex datatype as response in Application module service interface(Custom method).
    Is there any way to create it.
    I am able to create when i have simple datatype as response, Whereas the complex type is not able to create.
    Please give me some suggestion.
    Thanks
    Prabhat

    Hi
    I followed the below discussion and got the solution
    Create Web Services and return a complex type with ADF
    Thanks
    Prabhat

  • Creating tables with a long datatype

    I'm trying to create a table which is a copy of a table (and its contents) which has a long datatype column.
    I've got an error on the usual
    create table temp_XXXXX as select * from temp;
    statement.
    Any ideas please

    Can't be done using the CTAS syntax (see the SQL language reference for more details).
    To move LONG/LONG RAW data from one table to another will require some programming. If the LONG data is <32k you could do it in PL/SQL, otherwise you will need to do it in some other language/interface (maybe java?).

  • Can not create table with the CLOB type VARRAY, ORA-02348: cannot create VA

    CREATE OR REPLACE TYPE Project AS OBJECT (
    project_no NUMBER(2),
    title VARCHAR2(35),
    cost CLOB );
    CREATE OR REPLACE TYPE ProjectList AS VARRAY(50) OF Project;
    CREATE TABLE department (
    dept_id NUMBER(2),
    name VARCHAR2(15),
    budget NUMBER(11,2),
    projects ProjectList );
    The table creatation always with the error :
    ORA-02348: cannot create VARRAY column with embedded LOB
    Can anybody help ???

    Hi Peng,
    It seems you have hit a limitation of the Oracle version, which you don't post.
    Limitations are sometimes also called a 'feature'.
    You would need to find out whether this restriction has been lifted in a subsequent release or redesign your application.
    Sybrand Bakker
    Senior Oracle DBA

  • Cannot solve ORA-30756 "cannot create column or table of type that..."

    Hi there!
    I'm working on some excersises for the university but just can't get rid of this error.
    First, here's my SQL:
    [http://pastebin.com/f1266a668]
    And here is what I get:
    TYPE "LieferserviceTyp" Kompiliert.
    TYPE "ArtikelTyp" Kompiliert.
    TYPE "LebensmittelTyp" Kompiliert.
    TYPE "HaushaltswarenTyp" Kompiliert.
    TYPE "ArtikelInArtKombiTyp" Kompiliert.
    TYPE "ArtikelKombiTyp" Kompiliert.
    TYPE "ArtikelInKatalogTyp" Kompiliert.
    TYPE "KatalogTyp" Kompiliert.
    Fehler beim Start in Zeile 60 in Befehl:
    CREATE TABLE "Artikel" OF "ArtikelTyp" (
    PRIMARY KEY("artnr")
    Fehler bei Befehlszeile:60 Spalte:0
    Fehlerbericht:
    SQL-Fehler: ORA-30756: Spalte oder Tabelle mit einem Objekttyp, der ein Supertyp-Attribut enthält, kann nicht erstellt werden
    30756. 00000 - "cannot create column or table of type that contains a supertype attribute"
    *Cause:    The user tried to create a column or table of an object type that
    contains a supertype attribute. This is not supported because
    it leads to infinite recursion in our current storage model.
    Note that creating a column of a type implies that we
    create columns corresponding to all subtype attributes as well.
    *Action:   Change the type definition to contain a supertype REF attribute
    instead of the supertype object attribute.
    Fehler beim Start in Zeile 67 in Befehl:
    CREATE TABLE "Kataloge" OF "KatalogTyp" (
    PRIMARY KEY("katalog_id")
    Fehler bei Befehlszeile:67 Spalte:0
    Fehlerbericht:
    SQL-Fehler: ORA-30756: Spalte oder Tabelle mit einem Objekttyp, der ein Supertyp-Attribut enthält, kann nicht erstellt werden
    30756. 00000 - "cannot create column or table of type that contains a supertype attribute"
    *Cause:    The user tried to create a column or table of an object type that
    contains a supertype attribute. This is not supported because
    it leads to infinite recursion in our current storage model.
    Note that creating a column of a type implies that we
    create columns corresponding to all subtype attributes as well.
    *Action:   Change the type definition to contain a supertype REF attribute
    instead of the supertype object attribute.
    Fehler beim Start in Zeile 76 in Befehl:
    DROP TABLE "Artikel"
    Fehlerbericht:
    SQL-Fehler: ORA-00942: Tabelle oder View nicht vorhanden
    00942. 00000 - "table or view does not exist"
    *Cause:   
    *Action:
    Fehler beim Start in Zeile 77 in Befehl:
    DROP TABLE "Kataloge"
    Fehlerbericht:
    SQL-Fehler: ORA-00942: Tabelle oder View nicht vorhanden
    00942. 00000 - "table or view does not exist"
    *Cause:   
    *Action:
    DROP TYPE "KatalogTyp" erfolgreich.
    DROP TYPE "ArtikelInKatalogTyp" erfolgreich.
    DROP TYPE "ArtikelKombiTyp" erfolgreich.
    DROP TYPE "ArtikelInArtKombiTyp" erfolgreich.
    DROP TYPE "HaushaltswarenTyp" erfolgreich.
    DROP TYPE "LebensmittelTyp" erfolgreich.
    DROP TYPE "ArtikelTyp" erfolgreich.
    DROP TYPE "LieferserviceTyp" erfolgreich.
    The comments are in german but the structure should be clear I think.
    Any help appreciated!

    Unfortunately it's a bad idea to store your code samples (or screenshots or whatever) on an external site, because not everybody can get access to such sites, especially if their workplace has limitations on websites that can be visited.
    you're pastebin.com is one such site that I cannot access, so I can't see your code.
    If you want to paste code and/or data on the forums remember to put the tag: {noformat}{noformat} before _and_ after it, so that the formatting is maintained and it's easier for us to read.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for