2 Replies Latest reply: May 7, 2012 5:49 PM by Marco Gralike RSS

    ORA-00939 when creating XML table with Virtual Columns

    275191
      Getting error on creating table with VIRTUAL COLUMNS:

      Error at Command Line:4 Column:31
      Error report:
      SQL Error: ORA-00939: too many arguments for function
      00939. 00000 - "too many arguments for function"

      Without VIRTUAL COLUMNS works fine.

      Where to start?

      Is it possible to add Virtual Columns after a table is created?
      CREATE TABLE TDS_XML OF XMLType
      XMLSCHEMA "http://xmlns.abc.com/tds/TDSSchemaGen2.xsd"
      ELEMENT "TDSTestData"
        VIRTUAL COLUMNS
        (
        TESTID AS (
          XMLCast( 
                    XMLQuery('declare default element namespace "http://xmlns.abc.com/tds/TDSSchemaGen2.xsd"; /TDSTestData/TestID' PASSING OBJECT_VALUE RETURNING CONTENT)  AS VARCHAR2(32)
                 )
               )
         )
      SQL*Plus: Release 11.2.0.2.0 Production on Mon Apr 30 20:17:29 2012

      Copyright (c) 1982, 2010, Oracle. All rights reserved.


      Connected to:
      Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
      With the Partitioning, OLAP, Data Mining and Real Application Testing options

      SQL> select * from v$version;

      BANNER
      -------------------------------------------------------------------------------

      Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
      PL/SQL Release 11.2.0.2.0 - Production
      CORE 11.2.0.2.0 Production
      TNS for 64-bit Windows: Version 11.2.0.2.0 - Production
      NLSRTL Version 11.2.0.2.0 - Production

      SQL>