CLOB error?

When I run the Dbms_Xmlgen below, I get error:
"ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 71"
where line 71 is "Utl_File.Put_Line(l_Output, RESULT);" which I assume it is something to do with size/CLOB?
I have googled it and try to make changes, but could not get it to work.
The SQL statement works by itself.
Any suggestion?
Thanks
DECLARE
  l_Output    Utl_File.File_Type;
  p_Filename  VARCHAR2(50);
  Qryctx      Dbms_Xmlgen.Ctxhandle;
  RESULT      CLOB;
  Output_Date VARCHAR2(16);
BEGIN
  Output_Date := Substr(SYSDATE, 9, 2) || Substr(SYSDATE, 6, 2) ||
                 Substr(SYSDATE, 3, 2);               
  p_Filename  := 'listings.xml';
  l_Output    := Utl_File.Fopen('testing', p_Filename, 'w');
  Utl_File.Put(l_Output, '<?xml version="1.0" encoding="utf-8" ?> ');
  Qryctx := Dbms_Xmlgen.Newcontext('SELECT DISTINCT Evt.Event_Id Detail_Id,
                Tools_Pkg.Get_Parent_Programme_Detail_Id(Evt.Event_Id) Container_Id,
                Ch.Channel_Name,
                Tools_Pkg.Get_Time_Display_2(Evt.Start_Time, 1, 0) Start_Time,
                Tools_Pkg.Pad_To_Length(Uktv_Tools_Pkg.Bill_Time_Formatter(Evt.Original_Start_Time,
                                                                                1),
                                             8) Billed_Time,
                Tools_Pkg.Get_Time_Display_2((Evt.Start_Time + Evt.Duration),
                                             1,
                                             0) End_Time,
                To_Char(Evt.On_Date, ''DD/MM/YY'') Date,
                p.Promo_Name Original_Name,
                '''' Playlist_Name,
                0 Program_Id,
                0 Episode_Id,
                '''' Listing_Title,
                Tools_Pkg.Get_Time_Display_2(Evt.Duration, 1, 0) Duration,
                Pt.Playlist_Name House_Number,
                Ch.Channel_Id,
                '''' Application_Id,
                '''' Videoplusid,
                Otw.Owt,
                '''' Subtitled,
                '''' Signed,
                '''' Ad,
                c.Description Event_Type
  FROM Event                     Evt,
       Event_Technical_Data      Etd,
       Promo_Timing              Pt,
       Promo_Type                Ptype,
       Promo                     p,
       Additional_Fields_Channel Afc,
       Channel                   Ch,
       Event_Otw                 Otw,
       Codesc                    c
WHERE Evt.Event_Technical_Data_Id = Etd.Event_Technical_Data_Id
       AND Etd.Promo_Timing_Id = Pt.Promo_Timing_Id
       AND Pt.Promo_Type_Id = Ptype.Promo_Type_Id
       AND Ptype.Promo_Id = p.Promo_Id
       AND Evt.Channel_Id = Afc.Channel_Id
       AND Evt.On_Date >= ''01/jun/07''
       AND Evt.On_Date <= ''01/jun/07''
       AND Evt.Channel_Id = 3868
       AND Evt.Day_Type_Id = 1307000
       AND Evt.Kind_Code = 1094006 --c_Type_Promo
       AND Ch.Channel_Id = Afc.Channel_Id
       AND Evt.Detail_Id = Otw.Event_Id(+)
       AND p.Promo_Category_Code = c.Code
ORDER BY Date, Channel_Id, Start_Time');
  -- Set the row header to be TEST
  Dbms_Xmlgen.Setrowtag(Qryctx, 'TEST');
  -- Get the result
  RESULT := Dbms_Xmlgen.Getxml(Qryctx);
  Utl_File.Put_Line(l_Output, RESULT);
  Utl_File.Fclose(l_Output);
  --Close context
  Dbms_Xmlgen.Closecontext(Qryctx);
END;

Which is why I said to you in your other thread (Re: Creating XML documents that you would be better to use the DBMS_XMLDOM package to output everything in one go.
If you insist on using UTL_FILE then you are going to have to chop up your CLOB into pieces and output it bit by bit as there is a 32K limit on each piece you output with UTL_FILE.

Similar Messages

  • APEX Listener EA2 Standalone CLOB error

    I'm testing the APEX Listener EA2 release in Standalone mode on CentOS against Oracle XE.
    My RESTful service calls use the Media Resource type to return a CLOB that I format myself inside a function:
    select 'application/json', my_function_that_returns_json_in_a_clob from dual
    In the EA2 release, this is generating an error if the function returns more than 4000 bytes (works with 4000, fails with 4001). It is as though the function is getting cast as a varchar2 somewhere. I verified that the function will correctly return a large result to other sources (dbms_output, for instance).
    The APEX Listener Log reports the error as:
    oracle.dbtools.rt.web.HttpEndpointBase restfulServices
    SEVERE: ORA-22922: nonexistent LOB value
    Here's a Test Case:
    create or replace function test_size(p_cnt in integer) return clob
    is
    l_clob clob;
    begin
    for i in 1..p_cnt loop
    l_clob:=l_clob||'a';
    end loop;
    return l_clob;
    end;
    Then create a RESTful service call:
    Method: "GET"
    Source Type: "Media Resource"
    Source: select 'application/json', test_size(4001) from dual
    Thanks,
    Tim

    Thanks for your thorough reply!
    Unfortunately, your workaround doesn't fix the problem with EA2. It encounters the 4000 character limit as well.
    I understand your advice regarding using the QUERY type. I chose the Media Resource strategy for two main reasons:
    1. These services calls are for our mobile developers. Because they use some predefined frameworks for managing data that comes to the mobile app, they wanted the json to distinguish between data sets (rather than every data set being called "items"). I am able to format the json in such a way that it doesn't confuse their code. Is there another way to customize the format of the default json created by the QUERY type?
    2. I need to conduct some other business as part of the call. For instance, the service passes in a user's credentials which I use to authenticate and then retrieve the appropriate results based on who they are. Currently, I have stored procedures that authenticate APEX users or LDAP users.
    Perhaps old habits die hard, but I find that if I just do all of this myself in a stored function, I have all of the control I need. If you have other recommended strategies, I'm all ears.
    Thanks!
    _Tim                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • CLOB: Error in sending Notification email with Embedded message in the body

    Hi,
    Oracle Database 9.2.0.5.0
    Workflow version is : 2.6.3.5
    Apps Version is 11.5.10.1
    I am embedding a CLOB message document attribute to my Notification
    Message Body.
    Everything works fine when I check my notifications in the "workflow worklist"
    i.e. Oracle Apps. <Notifications> tab.
    but the emails are not going to the users and below message is displayed in the
    status monitor. (eventhough it displays below error - I can able to respond the notifications using the worklist and can able to COMPLETE the workflow process
    successfully)
    Please help me to resolve the below error, so that the Same notification which I am able to see using the workflow worklist should be sent to the user in email as embedded text.
    NOTE: there is no problem with the Package XXDB_OKC_CONTRACTS_WF_PKG, as it is not changed and I even verified it before and after this error that this package is indeed in VALID status.
    Workflow Errors: XXDBCAPR, SDA-10314
    Failed Activity Send Approve_Reject Responce Notification
    Activity Type Notice
    Error Name WF_ERROR
    Error Message [WF_ERROR] ERROR_MESSAGE=3835: Error '-20002 - ORA-20002: 2018: Unable to generate the notification XML. Caused by: 2020: Error when getting notification content. Caused by: ORA-04061: existing state of has been invalidated ORA-04061: existing state of package "APPS_FND.XXDB_OKC_CONTRACTS_WF_PKG" has been invalidated ORA-04065: not executed, altered or dropped package "APPS_FND.XXDB_OKC_CONTRACTS_WF_PKG" ORA-06508: PL/SQL: could not find program unit being called Wf_Notification.GetAttrClob(18841, MESSAGE_BODY, text/html) Wf_Notification.oldGetAttrC' encountered during execution of Generate function 'WF_XML.Generate' for event 'oracle.apps.wf.notification.send'. ERROR_STACK= WF_MAIL.GetLOBMessage3(18841, WFMAILER, 2020: Error when getting notification content. Caused by: ORA-04061: existing state of has been invalidated ORA-04061: existing state of package "APPS_FND.XXDB_OKC_CONTRACTS_WF_PKG" has been invalidated ORA-04065: not executed, altered or dropped package "APPS_FND.XXDB_OKC_CONTRACTS_WF_PKG" ORA-06508: PL/SQL: could not find program unit being called Wf_Notification.GetAttrClob(18841, MESSAGE_BODY, text/html) Wf_Notification.oldGetAttrClob(18841, MESSAGE_BODY, text/html) WF_NOTIFICATION.GetFullBody(nid => 18841, disptype => text/html) WF_MAIL.GetLOBMessage3(nid => 18841, r_ntf_pref => MAILHTML), Step -> Getting text/html body) WF_XML.GenerateDoc(oracle.apps.wf.notification.send, 18841) WF_XML.Generate(oracle.apps.wf.notification.send, 18841) WF_XML.Generate(oracle.apps.wf.notification.send, 18841) Wf_Event.setMessage(oracle.apps.wf.notification.send, 18841, WF_XML.Generate) Wf_Event.dispatch_internal()
    Error Stack
    thanks,
    Shashi
    NOTE: there is no problem with the Package XXDB_OKC_CONTRACTS_WF_PKG, as it is not changed and I even verified it before and after this error that this package is indeed in VALID status.

    Hi,
    Below solution worked for us :
    Whenever the document message related procedure is modified and compiled we need to STOP and START all the workflow related services,
    Homepage -> Workflow Manager -> Service Components => STOP all Services => Start All Services
    NOTE: Even when we bounced the database, application server the error is still occuring, only when we STOP and START the services whenever we compiled the document message procedures then the emails are getting processed.
    Metalink Forum note 588112.992 (ORA-04061: existing state of has been invalidated ORA-04061: existing state of package) is helpful in getting the solution Below is a snippet of the same :
    From: David Hsu 01-Aug-05 20:06
    Subject: Re : ORA-04061: existing state of has been invalidated ORA-04061:
    existing state of package
    Loren,
    we had a similar ORA-04061 error when we tried to compile a Workflow package
    after we modified it with new attributes. What we were told was that some
    workflow process or listener is still "thinking" the package is invalid even
    though it is valid. Whenever packages referred by the workflow process is
    changed, the Agent listeners and mailer must be bounced. Worst case scenario
    if the error still persist is that the database may have to be bounced as
    well.
    Please try bouncing the Agent listeners or, if it possible, bounce the
    database and see if you are still getting the error after that.
    The listeners that you need to bounce are all the listeners that you have
    enabled under OAM > Workflow Manager > Service Components,
    including the Workflow Notification Mailer.
    Hope this helps thanks,
    Shashi

  • JDBC CLOB error

    Hi,
    I face the following error, i use the oracle jdbc driver as db driver and i use the same ojdbc14.jar file as the project library, but when i try to cast the clob object return from resutlset it throw me class cast exception, i did print out the class name it shown oracle.sql.CLOB, but when i cast the object to oracle.sql.CLOB it still show me the error.
    Do you have any idea what is wrong?
    ====================// java code
    import java.sql.Clob;
    import oracle.sql.CLOB;
    Clob clob = null;
    if ( resultSet.next() )
    clob = resultSet.getClob( 1 );
    logger.debug( "resultSet.getClass() is " + resultSet.getClass() );
    logger.debug( "clob.getClass() is " + clob.getClass() );
    logger.debug( "clob is " + clob );
    logger.debug( "(clob instanceof oracle.sql.CLOB) is " + (clob instanceof oracle.sql.CLOB));
    CLOB oraClob = (CLOB)clob; // this is where the class cast exception occur
    ====================// log file
    [10/01/2005 15:51:26] b.crrs.common.CRRSParamServlet -- DEBUG -- selectUpdateStatement is [email protected]d5b222
    [10/01/2005 15:51:26] b.crrs.common.CRRSParamServlet -- DEBUG -- resultSet.getClass() is class oracle.jdbc.driver.OracleResultSetImpl
    [10/01/2005 15:51:26] b.crrs.common.CRRSParamServlet -- DEBUG -- clob.getClass() is class oracle.sql.CLOB
    [10/01/2005 15:51:26] b.crrs.common.CRRSParamServlet -- DEBUG -- clob is oracle.sql.CLOB@1a21321
    [10/01/2005 15:51:26] b.crrs.common.CRRSParamServlet -- DEBUG -- (clob instanceof oracle.sql.CLOB) is false
    [10/01/2005 15:51:26] b.crrs.common.CRRSParamServlet -- DEBUG -- error
    java.lang.ClassCastException

    See JDBC error for CLOB

  • Read CLOB error: ORA-03120

    Can anyone help me?
    When I use sql*plus to read CLOB field I got the error: ORA-03120 (tow task conversion routine: Integer overflow), why?
    my client:
    OS: NT2000
    ORACLE: 8.1.6i
    my server:
    OS: Solaris 8
    ORACLE: 8.1.6i

    Difficult to be precise without knowing database characterset and what language you are trying to view. But keep in mind, when a client application operates with a terminal that uses a different character set, then the client application's characters must be converted to the database character set and vice versa. This conversion is done automatically but depends on the NLS_LANG setting and the database character set. The character set used by the client application in this case SQL*PLUS is defined by the NLS_LANG parameter

  • Alter table reaching the max number of char 4000, CLOB? NCLOB?

    I have a column is a table defined as a VARCHAR2(4000)
    I try to alter the table
    alter table sybaapc
    MODIFY  SYBAAPC_EXTRACURRICULAR VARCHAR2(5000)but it give me this error
    ORA-00910: specified length too long for its datatype
    I want the users to be able to enter more information on that column.
    It seems that 4000 is the max we are in Oracle 10g
    can I changed to CLOB or nclob, we already have data in that table?
    What are the implications of changing it to clob or nclob,

    Thats becuase the maximum character length for a table column is 4000.
    Alternatively you can:
    SQL> create table test_1 (col1 VARCHAR2(4000))
      2  /
    Table created.
    SQL> insert into test_1 values(RPAD('*',4000,'*'));
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> alter table test_1 modify (col1 clob);
    alter table test_1 modify (col1 clob)
    ERROR at line 1:
    ORA-22858: invalid alteration of datatype
    SQL> alter table test_1 add(col2 clob);
    Table altered.
    SQL> update test_1 set col2 = col1;
    1 row updated.
    SQL> commit;
    Commit complete.
    SQL> alter table test_1 drop column col1;
    Table altered.
    SQL> alter table test_1 rename column col2 to col1;
    Table altered.
    SQL> desc test_1
    Name                                                  Null?    Type
    COL1                                                           CLOB
    SQL>
    SQL> select * from test_1;
    COL1
    SQL> Edited by: AP on Aug 24, 2010 7:41 AM

  • Alter varchar2 column to clob

    Hi all,
    have a table like :
    create table test(col1 varchar2(20),col2 number); -- with data
    now i have to change col1 to clob.
    alter table test modify col1 clob; ... is not working..
    can i change the data type to clob without dropping the table .. as it contains huge data.. i will take a lot of time repopulating it..

    Hi,
    You can cant modify from VARCHAR2 to CLOB but you can achieve your result like this:
    1. Add a new column as CLOB
    2. UPDATE varchar date to CLOB column;
    3. DROP VARCHAR column
    4. Rename CLOB column to VARCHAR column name
    SQL>CREATE TABLE t ( name VARCHAR2(20), age number(3));
    Table created.
    SQL>INSERT INTO t VALUES('aaa',20);
    1 row created.
    SQL>INSERT INTO t VALUES('bbb',30);
    1 row created.
    SQL>COMMIT;
    Commit complete.
    SQL>ALTER TABLE t MODIFY name CLOB;
    ALTER TABLE t MODIFY name CLOB
    ERROR at line 1:
    ORA-22858: invalid alteration of datatype
    SQL>ALTER TABLE t ADD tmp_name CLOB;
    Table altered.
    SQL>UPDATE t SET tmp_name=name;
    2 rows updated.
    SQL>
    SQL>ALTER TABLE t DROP COLUMN name;
    Table altered.
    SQL>
    SQL>ALTER TABLE t RENAME COLUMN tmp_name to name;
    Table altered.
    SQL>
    SQL>desc T;
    Name                                                  Null?    Type
    AGE                                                            NUMBER(3)
    NAME                                                           CLOB
    SQL>SELECT * FROM  v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    PL/SQL Release 9.2.0.6.0 - Production
    CORE    9.2.0.6.0       Production
    TNS for Solaris: Version 9.2.0.6.0 - Production
    NLSRTL Version 9.2.0.6.0 - Production
    5 rows selected.
    SQL>Regards

  • JDBC CLOB WRITER

    I do not know how to setup a Clob Writer - what is wrong with the following approach? (I'm getting a null pointeer exception?)
    - Tor
              Clob xmlClob = null;
              try {
                   db.open();
                   Connection c = db.getDbConnection();
                   ResultSet r = db
                             .sqlSELECT("select slm_xml_doc from slm for update ");
                   r.next();
                   ResultSetMetaData md = r.getMetaData();
                   System.out.println(" Col#: " + (1) + " Attribute: "
                             + md.getColumnName(1) + " DT: "
                             + md.getColumnTypeName(1));
                   Clob xmlclob = r.getClob(1);
              } catch (Exception s) {
                   System.out.println("DB or Clob Error: " + s.getMessage());
              try {
                   Writer writer = xmlClob.setCharacterStream(0);
              } catch (Exception s) {
                   System.out.println("Writer Error: " + s.getMessage());
    Output from unit test:
    INFO -Database connection is: oracle.jdbc.driver.T4CConnection@1172e08 (com.tor.sdmds.utilities.Database)
    Col#: 1 Attribute: SLM_XML_DOC DT: CLOB
    Writer Error: null

    FIXED - typo! Tor

  • Clobbered by a CLOB - Using C# in Visual Studio 2005

    Hello All,
    What I am trying to do:
    I am trying to insert a string as a CLOB into Oracle via C# using Visual Studio (VS) 2005.
    What I am using:
    The Oracle Tools for VS 2005 are installed and work fabulously with other types of data.
    Research I have done on my own:
    1. I have read the thread "ORA-01461"
    2. Have modified an example (see below) from the Oracle web site
    ..... as noted in the comments below (Jason Price).
    3. Addtionally, there are a number of www references.
    4. However, after a long unproductive day none are working for me.
    Error messages from Oracle (caught by the catch block):
    The error is: Oracle.DataAccess.Client.OracleException ORA-00936: missing expression at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure) at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src) at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) at Oracle.DataAccess.Client.OracleCommand.ExecuteReader() at clobSample.workThis() in c:\Documents and Settings\joe.user\My Documents\Visual Studio 2005\WebSites\HDTS\App_Code\clobSample.cs:line 71
    Thank you kind people of the Oracle Community,
    Mark
    *********** Code is Below ***********
    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    public class clobSample
    public clobSample()
    // TODO: Add constructor logic here
    public OracleConnection getConnectionString(string DBuser, string DBpass)
    // Build Connection String
    string connectionString = "Data Source=MY_DATA_SOURCE;User Id=";
    connectionString += DBuser + ";Password=";
    connectionString += DBpass + ";Persist Security Info=True";
    OracleConnection connection = new OracleConnection(connectionString);
    return connection;
    ClobExample4.cs shows how to update a CLOB
    using SELECT ... FOR UPDATE
    public string workThis()
    string strResult = "";
    try
    // create an OracleConnection object to connect to the database and open
    // the connection
    OracleConnection myOracleConnection =
    getConnectionString("DB_USER_NAME", "DB_PASSWORD");
    myOracleConnection.Open();
    // create an OracleCommand object to hold a SQL statement
    OracleCommand myOracleCommand = myOracleConnection.CreateCommand();
    // step 1: create an OracleTransaction object
    OracleTransaction myOracleTransaction =
    myOracleConnection.BeginTransaction();
    // step 2: read the row
    myOracleCommand.CommandText =
    "SELECT TICKET_NUM, COMMENT " +
    "FROM HDTS_TICKET_EVENTS " +
    "WHERE TICKET_NUM = 1 FOR UPDATE";
    // THIS IS WHERE THE CODE ERRORS OUT *
    OracleDataReader myOracleDataReader =
    myOracleCommand.ExecuteReader();
    myOracleDataReader.Read();
    // Console.WriteLine("myOracleDataReader[\"id\"] = " +
    // myOracleDataReader["id"]);
    // step 3: get the LOB locator
    OracleClob myOracleClob =
    myOracleDataReader.GetOracleClob(1);
    // step 4: write to the LOB
    myOracleClob.Erase();
    string text = "Alas poor Yoric, I knew him well";
    char[] charArray = text.ToCharArray();
    myOracleClob.Write(charArray, 0, charArray.Length);
    Console.WriteLine("myOracleClob.Value = " + myOracleClob.Value);
    // step 5: commit the transaction
    myOracleTransaction.Commit();
    // Console.WriteLine("Successfully committed transaction");
    // close the OracleDataReader and the OracleConnection object
    myOracleDataReader.Close();
    myOracleConnection.Close();
    // Console.WriteLine("\nPress any key to end");
    // Console.ReadLine();
    return strResult;
    } // close try
    catch (Exception e)
    strResult = "The error is: " + e;
    return strResult;
    } // close work this
    } // close clobSample class
    Edited by: microBiker on Sep 30, 2008 5:01 AM

    Hi,
    I dont think this has anyting to do with CLOB, but rather the use of a reserved word for a column name.
    How did you get the table created with a field named "COMMENT"? That's a reserved word so you shouldnt use it, even if you can someone force the database to accept it by using quotes for example...
    SQL> select count(*) from v$reserved_words where keyword='COMMENT';
    COUNT(*)
    1
    SQL> create table t1 (comment clob);
    create table t1 (comment clob)
    ERROR at line 1:
    ORA-00904: : invalid identifier
    SQL> create table t1 ("COMMENT" clob);
    Table created.
    SQL> select comment from t1;
    select comment from t1
    ERROR at line 1:
    ORA-00936: missing expression
    I assume the error might be stemming from that, as I see no reason for the code to error.
    Cheers,
    Greg

  • How to map an large XML document to the XMLType with TopLink in JDev

    Hello!
    We need to map an XML document in the Java String to an XMLType column. If the XML document has less than 4000 characters, we have no problems by using the DirectToField mapping. However, once the XML document has more than 4000 characters, using the DirectToField mapping, we got the error: Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.BatchUpdateException: ORA-01461: can bind a LONG value only for insert into a LONG column
    Then we have tried to use the "Type Conversion" mapping, to map it to the database type (Clob or NClob --oracle.toplink.oraclespecific). we got:
    Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00932: inconsistent datatypes: expected NUMBER got CLOB
    Error Code: 932
    Any suggestions?
    Thanks in advance!

    Thanks Matt! It works fine by using DirectToXMLTypeMapping.
    However, to get it work is not smooth. In particularly, we use Jdev in our project and Jdev has not included this feature yet. Therefore, I had to use the TopLink Workbench to create the descriptor file and cut&paste to the description file that generated by JDev. And also xdb.jar has to be part of the classpath.
    Then I come to an question -- how can we take some features that only provided by the TopLink Workbench into the Jdev environment without having to hack around?
    Thanks,
    s.c.

  • XML validation gives ORA-30937

    Hi,
    Could some one look at this as I am getting ORA-30937 while validating XML with a registered schema.
    Thanks in advance.
    Parappa
    SQL> DECLARE
    2 doc varchar2(3800) :=
    3 '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    4 <xs:schema targetNamespace="http://ibtco.com/common/exception/stack" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:stack="http://ibtco.com/common/exception/stack" elementFormDefault="qualified" attributeFormDefault="unqualified">
    5 <xs:complexType name="StackTextType">
    6 <xs:annotation>
    7 <xs:documentation>
    8 for holding the string information in exception
    9 </xs:documentation>
    10 </xs:annotation>
    11 <xs:simpleContent>
    12 <xs:extension base="xs:string"/>
    13 </xs:simpleContent>
    14 </xs:complexType>
    15 <xs:complexType name="StackElementType">
    16 <xs:annotation>
    17 <xs:documentation>
    18 for holding detail information in each stack element
    19 </xs:documentation>
    20 </xs:annotation>
    21 <xs:attribute name="Class" type="xs:Name" use="required"/>
    22 <xs:attribute name="Method" type="xs:Name" use="required"/>
    23 <xs:attribute name="LineNumber" type="xs:unsignedInt" use="required"/>
    24 <xs:attribute name="File" type="xs:Name" use="optional"/>
    25 <xs:attribute name="Native" type="xs:boolean" use="optional" default="false"/>
    26 </xs:complexType>
    27 <xs:complexType name="StackDetailType">
    28 <xs:annotation>
    29 <xs:documentation>
    30 for holding information in the stack trace
    31 </xs:documentation>
    32 </xs:annotation>
    33 <xs:sequence>
    34 <xs:element name="Element" type="stack:StackElementType" maxOccurs="unbounded"/>
    35 </xs:sequence>
    36 <xs:attribute name="Truncate" type="xs:boolean" use="optional" default="false"/>
    37 </xs:complexType>
    38 <xs:complexType name="RootExceptionType">
    39 <xs:annotation>
    40 <xs:documentation>
    41 for holding the stack trace information for each exception
    42 </xs:documentation>
    43 </xs:annotation>
    44 <xs:sequence>
    45 <xs:element name="Message" type="xs:string"/>
    46 <xs:choice>
    47 <xs:element name="StackDetail" type="stack:StackDetailType"/>
    48 <xs:element name="StackText" type="stack:StackTextType"/>
    49 </xs:choice>
    50 </xs:sequence>
    51 <xs:attribute name="Type" type="xs:NCName" use="required"/>
    52 </xs:complexType>
    53 <xs:complexType name="WrapperExceptionType">
    54 <xs:annotation>
    55 <xs:documentation>
    56 for defining top level element for exception stack
    57 </xs:documentation>
    58 </xs:annotation>
    59 <xs:sequence>
    60 <xs:element name="Message" type="xs:string"/>
    61 </xs:sequence>
    62 <xs:attribute name="Type" type="xs:NCName" use="required"/>
    63 </xs:complexType>
    64 <xs:element name="ExceptionStack">
    65 <xs:annotation>
    66 <xs:documentation>
    67 top level element exception stack
    68 </xs:documentation>
    69 </xs:annotation>
    70 <xs:complexType>
    71 <xs:sequence>
    72 <xs:element name="RootException" type="stack:RootExceptionType"/>
    73 <xs:element name="WrapperException" type="stack:WrapperExceptionType" minOccurs="0" maxOccurs="unbounded"/>
    74 </xs:sequence>
    75 </xs:complexType>
    76 </xs:element>
    77 </xs:schema>';
    78 BEGIN
    79 dbms_xmlschema.registerSchema('http://ibtco.com/common/exception/stack', doc);
    80 END;
    81 /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.07
    SQL> DECLARE
    2
    3 l_errormsgid VARCHAR2(30);
    4 l_errorinfo VARCHAR2(100);
    5 l_error_context CLOB; -- Error Stack
    6 l_error_context_data CLOB; -- XML Context
    7 l_var_xml_context VARCHAR2(4000);
    8 l_var_error_stack VARCHAR2(4000);
    9 l_sqlCode UTL_ERROR_LOGS.ERROR_CODE%TYPE;
    10 p_ErrorMsgId NUMBER := '0';
    11 p_ErrorInfo VARCHAR2(2000):= 'SUCCESS';
    12 l_xml_context SYS.XMLTYPE;
    13 l_count number :=0;
    14 l_ret NUMBER;
    15 BEGIN
    16
    17
    18
    19 -- Store XML in a clob
    20
    21 l_var_error_stack :=
    22 '<?xml version="1.0" encoding="UTF-8"?>
    23 <!--Sample XML file generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
    24 <ExceptionStack
    25 xmlns="http://ibtco.com/common/exception/stack"
    26 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    27 xsi:schemaLocation="http://ibtco.com/common/exception/stack
    28 http://ibtco.com/common/exception/stack"
    29 >
    30 <Exception Type="RootCauseException">
    31 <Message>Exception Message</Message>
    32 <StackDetail Truncate="false">
    33 <Element LineNumber="0" File="Exception.java" Class="com.ibtco.common.exception.ExceptionManager" Method="manage" Native="false"/>
    34 <Element LineNumber="0" File="Exception.java" Class="com.ibtco.common.exception.ExceptionHandler" Method="handle" Native="false"/>
    35 <Element LineNumber="0" File="Exception.java" Class="com.ibtco.common.exception.Exception" Method="throw" Native="false"/>
    36 </StackDetail>
    37 </Exception>
    38 <Cause Type="WrappedException">
    39 <Message>String</Message>
    40 <StackDetail/>
    41 </Cause>
    42 <Cause Type="AnotherWrappedException">
    43 <Message>String</Message>
    44 <StackDetail/>
    45 </Cause>
    46 </ExceptionStack>';
    47
    48 DBMS_LOB.CREATETEMPORARY
    49 (
    50 lob_loc => l_error_context,
    51 cache => TRUE
    52 );
    53
    54 DBMS_LOB.WRITE
    55 (
    56 lob_loc =>l_error_context,
    57 amount => length(l_var_error_stack),
    58 offset => 1,
    59 buffer => l_var_error_stack
    60 );
    61
    62 l_xml_context := XMLTYPE(l_error_context);
    63
    64
    65 -- validate against XML schema
    66 --l_xml_context.schemavalidate();
    67 l_ret := l_xml_context.isschemavalid('http://ibtco.com/common/exception/stack');
    68 IF l_ret = 1 then
    69 dbms_output.put_line('Data is valid:' || l_ret );
    70 ELSE
    71 dbms_output.put_line('Data is invalid:' || l_ret);
    72 END IF;
    73 END;
    74 /
    DECLARE
    ERROR at line 1:
    ORA-30937: No schema definition for 'Exception' (namespace 'http://ibtco.com/common/exception/stack') in parent 'ExceptionStack'
    ORA-06512: at "SYS.XMLTYPE", line 348
    ORA-06512: at line 67
    Elapsed: 00:00:00.00
    SQL>
    Here are the actual scripts:
    DECLARE
    doc varchar2(3800) :=
    '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <xs:schema targetNamespace="http://ibtco.com/common/exception/stack" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:stack="http://ibtco.com/common/exception/stack" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:complexType name="StackTextType">
              <xs:annotation>
                   <xs:documentation>
                        for holding the string information in exception
                   </xs:documentation>
              </xs:annotation>
              <xs:simpleContent>
                   <xs:extension base="xs:string"/>
              </xs:simpleContent>
         </xs:complexType>
         <xs:complexType name="StackElementType">
              <xs:annotation>
                   <xs:documentation>
                        for holding detail information in each stack element
                   </xs:documentation>
              </xs:annotation>
              <xs:attribute name="Class" type="xs:Name" use="required"/>
              <xs:attribute name="Method" type="xs:Name" use="required"/>
              <xs:attribute name="LineNumber" type="xs:unsignedInt" use="required"/>
              <xs:attribute name="File" type="xs:Name" use="optional"/>
              <xs:attribute name="Native" type="xs:boolean" use="optional" default="false"/>
         </xs:complexType>
         <xs:complexType name="StackDetailType">
              <xs:annotation>
                   <xs:documentation>
                        for holding information in the stack trace
                   </xs:documentation>
              </xs:annotation>
              <xs:sequence>
                   <xs:element name="Element" type="stack:StackElementType" maxOccurs="unbounded"/>
              </xs:sequence>
              <xs:attribute name="Truncate" type="xs:boolean" use="optional" default="false"/>
         </xs:complexType>
         <xs:complexType name="RootExceptionType">
              <xs:annotation>
                   <xs:documentation>
                        for holding the stack trace information for each exception
                   </xs:documentation>
              </xs:annotation>
              <xs:sequence>
                   <xs:element name="Message" type="xs:string"/>
                   <xs:choice>
                        <xs:element name="StackDetail" type="stack:StackDetailType"/>
                        <xs:element name="StackText" type="stack:StackTextType"/>
                   </xs:choice>
              </xs:sequence>
              <xs:attribute name="Type" type="xs:NCName" use="required"/>
         </xs:complexType>
         <xs:complexType name="WrapperExceptionType">
              <xs:annotation>
                   <xs:documentation>
                        for defining top level element for exception stack
                   </xs:documentation>
              </xs:annotation>
              <xs:sequence>
                   <xs:element name="Message" type="xs:string"/>
              </xs:sequence>
              <xs:attribute name="Type" type="xs:NCName" use="required"/>
         </xs:complexType>
         <xs:element name="ExceptionStack">
              <xs:annotation>
                   <xs:documentation>
                        top level element exception stack
                   </xs:documentation>
              </xs:annotation>
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="RootException" type="stack:RootExceptionType"/>
                        <xs:element name="WrapperException" type="stack:WrapperExceptionType" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>';
    BEGIN
    dbms_xmlschema.registerSchema('http://ibtco.com/common/exception/stack', doc);
    END;
    -- Validate Error Stack XML
    DECLARE
         l_errormsgid VARCHAR2(30);
         l_errorinfo VARCHAR2(100);
         l_error_context          CLOB; -- Error Stack
         l_error_context_data     CLOB;     -- XML Context
         l_var_xml_context     VARCHAR2(4000);
         l_var_error_stack     VARCHAR2(4000);
         l_sqlCode          UTL_ERROR_LOGS.ERROR_CODE%TYPE;
         p_ErrorMsgId NUMBER := '0';
         p_ErrorInfo VARCHAR2(2000):= 'SUCCESS';
         l_xml_context SYS.XMLTYPE;
         l_count number :=0;
    l_ret     NUMBER;
    BEGIN
         -- Store XML in a clob
         l_var_error_stack :=
    '<?xml version="1.0" encoding="UTF-8"?>
    <!--Sample XML file generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
    <ExceptionStack
    xmlns="http://ibtco.com/common/exception/stack"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://ibtco.com/common/exception/stack
    http://ibtco.com/common/exception/stack"
    >
    <Exception Type="RootCauseException">
    <Message>Exception Message</Message>
    <StackDetail Truncate="false">
    <Element LineNumber="0" File="Exception.java" Class="com.ibtco.common.exception.ExceptionManager" Method="manage" Native="false"/>
    <Element LineNumber="0" File="Exception.java" Class="com.ibtco.common.exception.ExceptionHandler" Method="handle" Native="false"/>
    <Element LineNumber="0" File="Exception.java" Class="com.ibtco.common.exception.Exception" Method="throw" Native="false"/>
    </StackDetail>
    </Exception>
    <Cause Type="WrappedException">
    <Message>String</Message>
    <StackDetail/>
    </Cause>
    <Cause Type="AnotherWrappedException">
    <Message>String</Message>
    <StackDetail/>
    </Cause>
    </ExceptionStack>';
         DBMS_LOB.CREATETEMPORARY
    lob_loc => l_error_context,
    cache => TRUE
         DBMS_LOB.WRITE
         lob_loc =>l_error_context,
         amount => length(l_var_error_stack),
         offset => 1,
         buffer => l_var_error_stack
         l_xml_context := XMLTYPE(l_error_context);
         -- validate against XML schema
         --l_xml_context.schemavalidate();
         l_ret := l_xml_context.isschemavalid('http://ibtco.com/common/exception/stack');
         IF l_ret = 1 then
              dbms_output.put_line('Data is valid:' || l_ret );
         ELSE
              dbms_output.put_line('Data is invalid:' || l_ret);
         END IF;
    END;
    /

    You schema definition goes like this:
    <xs:element name="ExceptionStack">
    <xs:annotation>
    <xs:documentation>
    top level element exception stack
    </xs:documentation>
    </xs:annotation>
    <xs:complexType>
    <xs:sequence>
    <xs:element name="RootException" type="stack:RootExceptionType"/>
    <xs:element name="WrapperException" type="stack:WrapperExceptionType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>and your document goes like this:
    <ExceptionStack
    xmlns="http://ibtco.com/common/exception/stack"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://ibtco.com/common/exception/stack
    http://ibtco.com/common/exception/stack"
    >
    <Exception Type="RootCauseException">
    <Message>Exception Message</Message>
    <StackDetail Truncate="false">
    .In your schema definition, you have not defined the element named "Exception" or element named "Cause", but are using it in your document. You need to fix either the schema definition or the document to make them consistent.
    Message was edited by:
    Kamal Kishore

  • XML Validation : isschemavalid always returns 0

    Hello XML folks,
    I have registered the schema and tried to validate. It always returns 0 (i.e invalid).
    Could you please let me know what is wrong with XSD or XML
    Thanks,
    Parappa
    SQL> DECLARE
    2 doc varchar2(3800) :=
    3 '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    4 <!--W3C Schema generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
    5 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:context="http://ibtco.com/common/exception/context" targetNamespace="http://ibtco.com/common/exception/context" elementFormDefault="qualified" attributeFormDefault="unqualified">
    6 <xs:simpleType name="ContextValueType">
    7 <xs:annotation>
    8 <xs:documentation>data types for properties</xs:documentation>
    9 </xs:annotation>
    10 <xs:restriction base="xs:string">
    11 <xs:enumeration value="boolean"/>
    12 <xs:enumeration value="char"/>
    13 <xs:enumeration value="byte"/>
    14 <xs:enumeration value="int"/>
    15 <xs:enumeration value="long"/>
    16 <xs:enumeration value="float"/>
    17 <xs:enumeration value="double"/>
    18 <xs:enumeration value="decimal"/>
    19 <xs:enumeration value="date"/>
    20 <xs:enumeration value="time"/>
    21 <xs:enumeration value="dateTime"/>
    22 <xs:enumeration value="string"/>
    23 </xs:restriction>
    24 </xs:simpleType>
    25 <xs:complexType name="ContextPropertyType">
    26 <xs:annotation>
    27 <xs:documentation>
    28 for holding name/value pair for application data
    29 </xs:documentation>
    30 </xs:annotation>
    31 <xs:simpleContent>
    32 <xs:extension base="xs:string">
    33 <xs:attribute name="Name" type="xs:Name" use="required"/>
    34 <xs:attribute name="Type" type="context:ContextValueType" use="optional"/>
    35 </xs:extension>
    36 </xs:simpleContent>
    37 </xs:complexType>
    38 <xs:complexType name="ExceptionContextType">
    39 <xs:annotation>
    40 <xs:documentation>
    41 for holding the data from applications
    42 </xs:documentation>
    43 </xs:annotation>
    44 <xs:sequence>
    45 <xs:element name="Property" type="context:ContextPropertyType" minOccurs="0" maxOccurs="unbounded"/>
    46 </xs:sequence>
    47 </xs:complexType>
    48 <xs:element name="ExceptionContext" type="context:ExceptionContextType">
    49 <xs:annotation>
    50 <xs:documentation>
    51 top level element exception context
    52 </xs:documentation>
    53 </xs:annotation>
    54 </xs:element>
    55 </xs:schema>';
    56 BEGIN
    57 dbms_xmlschema.registerSchema('http://ibtco.com/common/exception/context', doc);
    58 END;
    59 /
    PL/SQL procedure successfully completed.
    SQL> DECLARE
    2
    3 l_errormsgid VARCHAR2(30);
    4 l_errorinfo VARCHAR2(100);
    5 l_error_context CLOB; -- Error Stack
    6 l_error_context_data CLOB; -- XML Context
    7 l_var_xml_context VARCHAR2(4000);
    8 l_var_error_stack VARCHAR2(4000);
    9 l_sqlCode UTL_ERROR_LOGS.ERROR_CODE%TYPE;
    10 p_ErrorMsgId NUMBER := '0';
    11 p_ErrorInfo VARCHAR2(2000):= 'SUCCESS';
    12 l_xml_context SYS.XMLTYPE;
    13 l_count number :=0;
    14 l_ret NUMBER;
    15 BEGIN
    16
    17
    18 -- Store XML in a clob
    19 /*
    20 l_var_xml_context := '<ExceptionContext>
    21 <Property Name="Name1" Type="boolean">true</Property>
    22 <Property Name="Name2" Type="string">String</Property>
    23 </ExceptionContext>';
    24 */
    25
    26 l_var_xml_context := '<?xml version="1.0" encoding="UTF-8"?>
    27 <!--Sample XML file generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
    28 <ExceptionContext
    29 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    30 xsi:schemaLocation="http://ibtco.com/common/exception/context"
    31 >
    32 <Property Name="Name1" Type="boolean">true</Property>
    33 <Property Name="Name2" Type="string">String</Property>
    34 </ExceptionContext>';
    35
    36 DBMS_LOB.CREATETEMPORARY
    37 (
    38 lob_loc => l_error_context_data,
    39 cache => TRUE
    40 );
    41
    42 DBMS_LOB.WRITE
    43 (
    44 lob_loc =>l_error_context_data,
    45 amount => length(l_var_xml_context),
    46 offset => 1,
    47 buffer => l_var_xml_context
    48 );
    49
    50 l_xml_context := XMLTYPE(l_error_context_data);
    51
    52
    53 -- validate against XML schema
    54 --l_xml_context.schemavalidate();
    55 l_ret := l_xml_context.isschemavalid('"http://ibtco.com/common/exception/context"');
    56 IF l_ret = 1 then
    57 dbms_output.put_line('Data is valid:' || l_ret );
    58 ELSE
    59 dbms_output.put_line('Data is invalid:' || l_ret);
    60 END IF;
    61 END;
    62 /
    Data is invalid:0
    PL/SQL procedure successfully completed.
    SQL>
    SQL>
    Here is the script :
    DECLARE
    doc varchar2(3800) :=
    '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!--W3C Schema generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:context="http://ibtco.com/common/exception/context" targetNamespace="http://ibtco.com/common/exception/context" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:simpleType name="ContextValueType">
              <xs:annotation>
                   <xs:documentation>data types for properties</xs:documentation>
              </xs:annotation>
              <xs:restriction base="xs:string">
                   <xs:enumeration value="boolean"/>
                   <xs:enumeration value="char"/>
                   <xs:enumeration value="byte"/>
                   <xs:enumeration value="int"/>
                   <xs:enumeration value="long"/>
                   <xs:enumeration value="float"/>
                   <xs:enumeration value="double"/>
                   <xs:enumeration value="decimal"/>
                   <xs:enumeration value="date"/>
                   <xs:enumeration value="time"/>
                   <xs:enumeration value="dateTime"/>
                   <xs:enumeration value="string"/>
              </xs:restriction>
         </xs:simpleType>
         <xs:complexType name="ContextPropertyType">
              <xs:annotation>
                   <xs:documentation>
                        for holding name/value pair for application data
                   </xs:documentation>
              </xs:annotation>
              <xs:simpleContent>
                   <xs:extension base="xs:string">
                        <xs:attribute name="Name" type="xs:Name" use="required"/>
                        <xs:attribute name="Type" type="context:ContextValueType" use="optional"/>
                   </xs:extension>
              </xs:simpleContent>
         </xs:complexType>
         <xs:complexType name="ExceptionContextType">
              <xs:annotation>
                   <xs:documentation>
                        for holding the data from applications
                   </xs:documentation>
              </xs:annotation>
              <xs:sequence>
                   <xs:element name="Property" type="context:ContextPropertyType" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
         <xs:element name="ExceptionContext" type="context:ExceptionContextType">
              <xs:annotation>
                   <xs:documentation>
                        top level element exception context
                   </xs:documentation>
              </xs:annotation>
         </xs:element>
    </xs:schema>';
    BEGIN
    dbms_xmlschema.registerSchema('http://ibtco.com/common/exception/context', doc);
    END;
    DECLARE
         l_errormsgid VARCHAR2(30);
         l_errorinfo VARCHAR2(100);
         l_error_context          CLOB; -- Error Stack
         l_error_context_data     CLOB;     -- XML Context
         l_var_xml_context     VARCHAR2(4000);
         l_var_error_stack     VARCHAR2(4000);
         l_sqlCode          UTL_ERROR_LOGS.ERROR_CODE%TYPE;
         p_ErrorMsgId NUMBER := '0';
         p_ErrorInfo VARCHAR2(2000):= 'SUCCESS';
         l_xml_context SYS.XMLTYPE;
         l_count number :=0;
    l_ret     NUMBER;
    BEGIN
         -- Store XML in a clob
         l_var_xml_context := '<ExceptionContext>
    <Property Name="Name1" Type="boolean">true</Property>
    <Property Name="Name2" Type="string">String</Property>
    </ExceptionContext>';
         l_var_xml_context := '<?xml version="1.0" encoding="UTF-8"?>
    <!--Sample XML file generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
    <ExceptionContext
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://ibtco.com/common/exception/context"
    >
    <Property Name="Name1" Type="boolean">true</Property>
    <Property Name="Name2" Type="string">String</Property>
    </ExceptionContext>';
         DBMS_LOB.CREATETEMPORARY
    lob_loc => l_error_context_data,
    cache => TRUE
         DBMS_LOB.WRITE
         lob_loc =>l_error_context_data,
         amount => length(l_var_xml_context),
         offset => 1,
         buffer => l_var_xml_context
         l_xml_context := XMLTYPE(l_error_context_data);
         -- validate against XML schema
         --l_xml_context.schemavalidate();
         l_ret := l_xml_context.isschemavalid('"http://ibtco.com/common/exception/context"');
         IF l_ret = 1 then
              dbms_output.put_line('Data is valid:' || l_ret );
         ELSE
              dbms_output.put_line('Data is invalid:' || l_ret);
         END IF;
    END;
    /

    problem was with the parameter you have passed as schema url.
    here is the modified code.
    problem was in this line.
    l_xml_context.isschemavalid('"http://ibtco.com/common/exception/context"');
    you have to pass the url as just a string without the double quotest (").
    now it returns 1.
    SQL> DECLARE
    2 l_var_xml_context VARCHAR2(4000);
    3 l_xml_context SYS.XMLTYPE;
    4 l_ret NUMBER;
    5 BEGIN
    6 l_var_xml_context := '<?xml version="1.0" encoding="UTF-8"?>
    7 <ExceptionContext xmlns="http://ibtco.com/common/exception/context" xmlns:xsi="http://www.w3.o
    rg/2001/XMLSchema-instance" xsi:schemaLocation="http://ibtco.com/common/exception/context
    8 http://ibtco.com/common/exception/context">
    9 <Property Name="Name1" Type="boolean">true</Property>
    10 <Property Name="Name2" Type="string">String</Property>
    11 </ExceptionContext>';
    12 l_xml_context := XMLTYPE(l_var_xml_context);
    13
    14 l_ret := l_xml_context.isschemavalid('http://ibtco.com/common/exception/context');
    15 IF l_ret = 1 then
    16 dbms_output.put_line('Data is valid:' || l_ret );
    17 ELSE
    18 dbms_output.put_line('Data is invalid:' || l_ret);
    19 END IF;
    20 END;
    21 /
    Data is valid:1

  • Receiving an ORA-31020: The operation is not allowed...

    I'm trying to use a stylesheet that has several included stylesheets.
    It looks something like this...
    <?xml version='1.0'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:include href="http://fhamiwsdt01/AMIWeb/namespaces/AmerisureClient.xsl"/>
    <xsl:include href="http://fhamiwsdt01/AMIWeb/namespaces/AmerisurePolicy.xsl"/>
    <xsl:include href="http://fhamiwsdt01/AMIWeb/namespaces/AmerisureRetailAgent.xsl"/>
    <xsl:include href="http://fhamiwsdt01/AMIWeb/namespaces/TransactionUtilities.xsl"/>
    My procedure is to grab an xml an bump it up against the stylesheet as follows.
    CREATE OR REPLACE FUNCTION transformPolicyXml RETURN CLOB IS
    -- Define the local variables
    xmldata XMLType;
    xsldata XMLType;
    newxml XMLType;
    xml clob;
    xsl clob;
    error varchar2(200);
    BEGIN
    -- Get the XML document using the getXML() function defined in the database.
    -- Since XMLType.transform() method takes XML data as XMLType instance,
    -- use the XMLType.createXML method to convert the XML content received
    -- as CLOB into an XMLType instance.
    xml := getxml('Policy.xml');
    xmldata := XMLType.createXML(xml);
    -- Get the XSL Stylesheet using the getXSL() function defined in the database.
    -- Since XMLType.transform() method takes an XSL stylesheet as XMLType instance,
    -- use the XMLType.createXML method to convert the XSL content received as CLOB
    -- into an XMLType instance.
    xsl := getxml('Amerisure EAI XSLT.xsl');
    xsldata := XMLType.createXML(xsl);
    -- Use the XMLtype.transform() function to get the transformed XML instance.
    -- This function applies the stylesheet to the XML document and returns a transformed
    -- XML instance.
    newxml := xmldata.transform(xsldata);
    -- Return the transformed XML instance as a CLOB value.
    RETURN newxml.getClobVal();
    EXCEPTION WHEN OTHERS THEN
    error := sqlerrm;
    raise_application_error (-20102, 'Exception occurred in transformPolicyXml :'||SQLERRM);
    END transformPolicyXml;
    The following statement is what causes an error:
    newxml := xmldata.transform(xsldata);
    the error i'm receiving is ORA-31020: The operation is not allowed, Reason: For security reasons, ftp and http access over XDB repository is not allowed on server side.
    Is there anyway to get around this error?

    As the error says, the XML DB does not allow ftp or http access to remote objects.
    You will need to make all your includes local to the DB server.

  • Multiple Cubes refresh in parallel

    Hi
    I have an analytical workspace where i have modelled a set of conformed dimensions and some dimensions specific to specific subject areas. There will be multiple cubes (Partitioned and some non partitioned) in this analytical workspace.
    Would like to know if these cubes can be refreshed in parallel. I have tried using DBMS_CUBE provided parallelism parameter and kicked off 2 cubes refresh but when i check the cube_build_log, the slave process is always 0 and the execution seems to have happened in serial.
    Please suggest how these cubes can be refreshed in parallel.
    Thanks

    FAILED RECORDS FROM THE LOG :
    ==========================
    127     0     FAILED     BUILD          BUILD     "(CLOB) <ERROR>
    <![CDATA[
    XOQ-01707: Oracle job "IncrMyCBMV_JOB$_812" failed while executing slave build "GLOBAL.UNITS_CUBE USING (CLEAR LEAVES, LOAD, SOLVE) AS OF SCN 1533406" with error "37162: ORA-37162: OLAP error
    XOQ-00703: error executing OLAP DML command "(UPDATE GLOBAL.GLOBAL : ORA-37605: error during OLAP AW UPDATE
    ORA-00600: internal error code, arguments: [kdliLockBlock], [9708], [16859386], [0], [0], [0], [0], [], [], [], [], []
    ORA-06512: at "SYS.DBMS_CUBE", line 234
    ORA-06512: at "SYS.DBMS_CUBE", line 316
    ORA-06512: at line 1
    ".]]>>
    </ERROR>"     GLOBAL     GLOBAL               02-APR-13 12.25.43.702000000 PM ASIA/CALCUTTA     (CLOB) BUILD price_cube, units_cube     DBMS_CUBE     0               4542     0     0     2     IncrMyCBMV
    127     0     FAILED     SLAVE     UNITS_CUBE     CUBE          GLOBAL     GLOBAL     P22:1999.10     IncrMyCBMV_JOB$_821     02-APR-13 12.25.42.673000000 PM ASIA/CALCUTTA     (CLOB) GLOBAL.UNITS_CUBE USING (CLEAR LEAVES, LOAD, SOLVE) AS OF SCN 1533406     DBMS_CUBE     1          S     6288     230     0     3     IncrMyCBMV
    127     0     FAILED     SLAVE     UNITS_CUBE     CUBE          GLOBAL     GLOBAL     P24:1999.12     IncrMyCBMV_JOB$_819     02-APR-13 12.25.32.533000000 PM ASIA/CALCUTTA     (CLOB) GLOBAL.UNITS_CUBE USING (CLEAR LEAVES, LOAD, SOLVE) AS OF SCN 1533406     DBMS_CUBE     1          S     6272     228     0     3     IncrMyCBMV
    127     0     FAILED     SLAVE     UNITS_CUBE     CUBE          GLOBAL     GLOBAL     P25:2000.01     IncrMyCBMV_JOB$_818     02-APR-13 12.25.30.505000000 PM ASIA/CALCUTTA     (CLOB) GLOBAL.UNITS_CUBE USING (CLEAR LEAVES, LOAD, SOLVE) AS OF SCN 1533406     DBMS_CUBE     1          S     6259     227     0     3     IncrMyCBMV
    127     0     FAILED     SLAVE     UNITS_CUBE     CUBE          GLOBAL     GLOBAL     P26:2000.02     IncrMyCBMV_JOB$_817     02-APR-13 12.25.28.477000000 PM ASIA/CALCUTTA     (CLOB) GLOBAL.UNITS_CUBE USING (CLEAR LEAVES, LOAD, SOLVE) AS OF SCN 1533406     DBMS_CUBE     1          S     6258     226     0     3     IncrMyCBMV
    127     0     FAILED     SLAVE     UNITS_CUBE     CUBE          GLOBAL     GLOBAL     P27:2000.03     IncrMyCBMV_JOB$_816     02-APR-13 12.25.26.449000000 PM ASIA/CALCUTTA     (CLOB) GLOBAL.UNITS_CUBE USING (CLEAR LEAVES, LOAD, SOLVE) AS OF SCN 1533406     DBMS_CUBE     1          S     6237     225     0     3     IncrMyCBMV
    127     0     FAILED     SLAVE     UNITS_CUBE     CUBE          GLOBAL     GLOBAL     P28:2000.04     IncrMyCBMV_JOB$_815     02-APR-13 12.25.24.421000000 PM ASIA/CALCUTTA     (CLOB) GLOBAL.UNITS_CUBE USING (CLEAR LEAVES, LOAD, SOLVE) AS OF SCN 1533406     DBMS_CUBE     1          S     6235     224     0     3     IncrMyCBMV
    127     0     FAILED     SLAVE     UNITS_CUBE     CUBE          GLOBAL     GLOBAL     P29:2000.05     IncrMyCBMV_JOB$_814     02-APR-13 12.25.22.393000000 PM ASIA/CALCUTTA     (CLOB) GLOBAL.UNITS_CUBE USING (CLEAR LEAVES, LOAD, SOLVE) AS OF SCN 1533406     DBMS_CUBE     1          S     6234     223     0     3     IncrMyCBMV
    127     0     FAILED     SLAVE     UNITS_CUBE     CUBE          GLOBAL     GLOBAL     P30:2000.06     IncrMyCBMV_JOB$_813     02-APR-13 12.25.20.349000000 PM ASIA/CALCUTTA     (CLOB) GLOBAL.UNITS_CUBE USING (CLEAR LEAVES, LOAD, SOLVE) AS OF SCN 1533406     DBMS_CUBE     1          S     6232     222     0     3     IncrMyCBMV

  • Sql query hint - first filter , then join

    hello
    i have a following query (based on OWB data model views)
    select /* + LEADING(all_iv_xform_map_components all_iv_xform_map_parameters) USE_NL(all_iv_xform_map_components all_iv_xform_map_parameters) */
    comp.map_name,
    comp.operator_type ,
    param.map_component_name ,
    param.parameter_name,
    md.map_component_id,
    md.map_component_name,
    mp.MAP_COMPONENT_ID     ,
    mp.MAP_COMPONENT_NAME     
    from all_iv_xform_map_components comp,
    all_iv_xform_map_parameters param,
    ALL_IV_XFORM_MAP_PROPERTIES mp,
    ALL_IV_XFORM_MAP_DETAILS md
    where comp.map_name = nvl('&load_map_name','LOAD_MY_TABLE')
    and param.map_component_id = comp.map_component_id
    and param.map_component_id=md.map_component_id
    and md.map_component_id=mp.map_component_id
    what i want to achieve is to force the query to first filter out the table all_iv_xform_map_components and do the join with the remainign tables on the filtered rows only;
    i tried using the above hint but its not working; oracle still grabs to the full table: ALL_IV_XFORM_MAP_PROPERTIES
    id appreciate any tips
    thanks
    rgds

    HI
    for the sake of the case:
    i ran your query and its giving the clob error
    i hard coded the com id's and its not giving error anymore
    WITH comp AS
    (   SELECT --+materialize
            comp.map_name,
            comp.operator_type,
            comp.map_component_id,
            param.map_component_name ,
            param.parameter_name
        FROM
            all_iv_xform_map_components comp,
            all_iv_xform_map_parameters param
        WHERE
            comp.map_name = nvl('&load_map_name','LOAD_MY_TABLE)
        AND param.map_component_id = comp.map_component_id
        AND param.map_component_id  in ('3931622','3931625','3931624','3931623','3931626')  --> without this line its giving clob error, but these are the only comp ids retured by that query
    select
        comp.map_name,
        comp.operator_type ,
        comp.map_component_name ,
        comp.parameter_name,
        md.map_component_id,
        md.map_component_name,
        mp.MAP_COMPONENT_ID ,
        mp.MAP_COMPONENT_NAME
    from
        comp,
        ALL_IV_XFORM_MAP_PROPERTIES mp,
        ALL_IV_XFORM_MAP_DETAILS md
    where
        comp.map_component_id = md.map_component_id
    and comp.map_component_id = mp.map_component_id
    /

Maybe you are looking for

  • Multiple email accounts on Lumia 800

    Dear All I have a question about email accounts on the Lumia 800. I have two email accounts, one linked to our website (pop 3) and also my personal Live account.  The account linked to the website can only receive (it costs more and thus was deemed u

  • Transfer of data from blackberry to iphone

    how do you transfer all data pics emails and contacts etc to iphone from blackberry easily?

  • ADF - managed bean error in dynamic menu creation

    scenario: to create dynamic menu for two tabs : general.. general has a subtabmenu in form of menubar wid items: country, city,... i created dynamic menus for my application.wen i ran my page i got this error: SEVERE: Managedbean menuItem_General cou

  • HP MINI 200-4218TU

    Good day! my HP mini had been reformat 2 weeks ago. now it cannot connect to a projector and can't read flash drives, how can i have these things again. thank you.

  • Remediation status in OIA-Urgent

    Hi Experts, I need to find actual remediation status (required,completed),remediation end_date(remediation completion date) for all accounts and entitlements for a perticular certification displaying in remediation tracking tab. I am retrieving from