Accesing XMLType from OCCI

Anyone could send me an example os using OCCI for querying a table with a XMLType?
(Oracle 9i)

Hi,
Try this:
//xmldoc is field of XMLType.
stmt->setSQL("select e.xmldoc.getClobval() from xml e");
ResultSet *rs = stmt->executeQuery();
while ( rs->next() )
Clob clob = rs->getClob(1);
if(clob.isNull())
cout<<"clob is NULL"<<endl;
else
int length = clob.length();
char* buffer = new char[length];
memset(buffer, ' ', length);
clob.read(length, (unsigned char*)buffer, length, 1);
cout<<buffer<<endl;
good luck,
michal aniol

Similar Messages

  • Access violation after changing from OCCI 10g to OCCI 11g

    I am moving my program from OCCI 10g and Visual Studio 2005 (VC8) to OCCI 11g and Visual Studio 2008 (VC9). I have downloaded the new instant client and SDK files (11.2.0.1), and everything builds OK. Using OCCI 11g, my program can write a spatial table to our Oracle Spatial 10g database, but when I try to read the data back, I get an access violation reading a spatial object (SDO_GEOMETRY). I am able to read the spatial table I created using OCCI 11g successfully using an earlier version of my application that uses Instant Client 10g.
    I used OTT from 10g to create the class that wraps SDO_GEOMETRY. I tried generating new code from OTT in 11g, but the result matched the code generated in 10g.
    The crash happens in a call to oracle::occi::ResultSet::GetObject(), and the top method in the call stack that has source code is:
    // Note: this is part of the object wrapper generated by OTT.
    void SdoGeometryBase::readSQL(void ctxOCCI_)
    SdoGeometryBase *objOCCI_ = new(ctxOCCI_) SdoGeometryBase(ctxOCCI_);
    oracle::occi::AnyData streamOCCI_(ctxOCCI_); <--- Access violation happens on this call.
    This happens on the first attempt to read an SDO_GEOMETRY object.
    Has anyone run into a similar problem?
    Thanks,
    Bob

    I am bumping this thread in hopes that someone might have run into this same problem or be able to give me some suggestions as to how to go about solving it. My program can connect to the database and query the list of tables or other non-spatial data, but when I try to read an SDO_GEOMETRY object I get the crash described below. The crash happens on both Windows XP and Windows 7. As far as I can tell, I am using the latest instant client and SDK files for Oracle 11g.
    Were there any changes between 10g and 11g that would force me to change my code?
    Thanks,
    Bob

  • Calling SQL*Loader from OCCI

    Hi All,
    I need to access SQL*Loader from C++.
    I know there is an interface for OCI to access SQL*Loader.
    I also know there is a gnu project of a c++ wrapper to the OCI-SQL*Loader interface (odpd).
    According to the OCCI documentation it is just a C++ facade of OCI (with some goodies like thread managing , etc.).
    I want to know the following:
    1. How can I operate OCI from OCCI?
    2. Are there are source samples of operating OCI from OCCI or even better operating OCI SQL*Loader interface from OCCI?
    3. Are there are any known (/unknown :-) ) problems with either OCCI access to OCI or OCI interface itself to the SQL*Loader?
    Thanks,
    Arik

    Hi,
    If you have a OCCI application and you want to interoperate with OCI, you can retrieve the underlying OCI handles from OCCI objects and write OCI code.
    e.g :-
    //with Environment env, Connection conn OCCI objects
    OCIEnv *ocienv = env->getOCIEnv();
    OCISvcCtx *ocisvc = conn->getOCISvcCtx();
    //use OCI calls
    OCIError *errhp;
    OCIHandleAlloc (ocienv, &errhp, OCI_HTYPE_ERROR,...);
    OCIHandleAlloc (ocienv, &dpctx, OCI_HTYPE_DIRPATH_CTX,..);
    err = OCIDirPathLoadStream(...);
    OCCI does not have a direct path API at present.
    Thanks.

  • XMLTYPE from pooled connection

    Hello,
    I am using JDeveloper 10.1.3 and am trying to create an XMLTYPE from a pooled connection. Problem is I keep getting a ClassCastException: oracle_jdbc_driver_LogicalConnection_Proxy. I have no troubles whith a single connection to the database, only with a pooled connection.
    Any help would be appreciated.

    For anyone interested I figured out a solution. Instead of insert an XMLType directly, I'm converting the XML to a CLOB, inserting the clob and casting to XMLType within the sql. Here's the code:
    insert into xml_table (xml_field) values(XMLType(?)); //? = CLOB
    Later

  • How to return xmlType from Webservice generated with JDev and PL/SQL

    Hi,
    I have generated an PL/SQL package that's returning a value as xmlType.
    With JDeveloper I'm deploying this package as a webservice. When invoking the webservice from a webbrowser the result looks like:
    <?xml version="1.0" encoding="UTF-8" ?>
    <SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <ns1:testXmltypeResponse
    xmlns:ns1="http://app/webservice.wsdl"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <return xsi:type="xsd:string">
    <ROWSET>
    <ROW>
    <TODAY>12-OCT-07</TODAY>
    </ROW>
    </ROWSET>
    </return>
    </ns1:testXmltypeResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    The problem is that the <return> tag contains 'xsi:type="xsd:string"'. And now the webservice response is not valid XML because the return value contains XML and not a string.
    The solution would be, when invoking the webservice if the xsi:type would be missing from the result tag or would contains xsd:any. I tried editing the WSDL in JDeveloper and changing the type to xsd:any. After deploying and calling the WSDL from the webbrowser it contains this type. But when invoking the method from the webbrowser it still returns xsd:string as type.
    How can I get rid of this type in the <return> or change it.
    My JDeveloper version is 10.1.3.3.0 The Oracle database and 9iAS are 10.2.
    Thanks in advance,
    Thijs

    What version are you on?
    Works fine for me on my 11g:
    SQL> create or replace procedure testxml (clob_out out clob)
      2  is
      3     l_clob   clob;
      4     l_ctx    dbms_xmlquery.ctxhandle;
      5  begin
      6     l_ctx := dbms_xmlquery.newcontext ('select * from dual');
      7     l_clob := dbms_xmlquery.getxml (l_ctx);
      8     clob_out := l_clob;
      9     dbms_xmlquery.closecontext (l_ctx);
    10  end testxml;
    11  /
    Procedure created.
    SQL>
    SQL> variable vout clob;
    SQL>
    SQL> exec testxml (:vout)
    PL/SQL procedure successfully completed.
    SQL>
    SQL> print vout
    VOUT
    <?xml version = '1.0'?>
    <ROWSET>
       <ROW num="1">
          <DUMMY>X</DUMMY>
       </ROW>
    </ROWSET>But definitely you can optimize your proc a bit: Try
    create or replace procedure testxml (clob_out in out nocopy clob)
    is
       l_ctx    dbms_xmlquery.ctxhandle;
    begin
       l_ctx := dbms_xmlquery.newcontext ('select * from dual');
       clob_out := dbms_xmlquery.getxml (l_ctx);
       dbms_xmlquery.closecontext (l_ctx);
    end testxml;
    /

  • XMLTYPE from Pooled Connection throws ClassCastException

    Hello,
    I am developing a Java web application using Developer 10.1.3 that is tied to an Oracle database through a connection pool. The application is utilizing Oracle's xmldb libraries in order to store xml documents as XMLTYPE in the database.
    The troubles I'm running into are in the creation of an XMLType object. The line of code where everything blows up is:
         XMLType xType = XMLType.createXML(connection, xmldocument);
    The xml document is fine, the problem is with the connection. I keep getting a "ClassCastException: oracle_jdbc_driver_LogicalConnection_Proxy".
    The thing is, when I connect directory to the database through a single connection, everything works just fine. It's only when getting a connection from a pooled location.
    I've been banging my head trying to figure this out for over a week, so any help would be greatly appreciated.

    For anyone interested I figured out a solution. Instead of insert an XMLType directly, I'm converting the XML to a CLOB, inserting the clob and casting to XMLType within the sql. Here's the code:
    insert into xml_table (xml_field) values(XMLType(?)); //? = CLOB
    Later

  • ORA-03113 when inserting a CLOB value casted as an XMLType from a SELECT query into a table

    I have a table that contains a CLOB column with pseudo-XML in it. I want to keep this data in an XMLType column so that I can leverage some of Oracle's built-in XML features to parse it more easily.
    The source table is defined as:
    CREATE TABLE "TSS_SRM_CBEBRE_LOGS_V"
    ( "INCIDENT_ID" NUMBER,
    "EVENT_TYPE" VARCHAR2(100 BYTE) NOT NULL ENABLE,
    "EVENT_KEY" VARCHAR2(100 BYTE),
    "CREATION_DATE" TIMESTAMP (6) NOT NULL ENABLE,
    "CREATED_BY" VARCHAR2(100 BYTE) NOT NULL ENABLE,
    "LOG_MSG" CLOB);
    The target (for testing this problem) table is defined as:
    CREATE TABLE "TESTME"
    ( "LOG_MSG" "XMLTYPE"
    My query is:
    insert /*+ APPEND */ into testme ("LOG_MSG")
    select XMLTYPE.createXML("LOG_MSG") as LOG_MSG from "TSS_SRM_CBEBRE_LOGS_V" b;
    In SQL*Developer, my error is: Error report:
    SQL Error: No more data to read from socket
    In SQL*PLUS and Toad, my error is:
    ORA-03113: end-of-file on communication channel
    Process ID: 13903
    Session ID: 414 Serial number: 32739

    By pseudo-XML, I mean that it doesn't have the xml root node. The content structure is similar to the following:
    <a attr1="1" attr2="2" />
    <b attr1="3" attr2="4" />
    <c attr1="5">
    <e attr1="6" attr2="7" />
    <e attr1="8" attr2="9" />
    <e attr1="10" attr2="11" />
    </c>
    <d attr1="12" />
    OK. Those are XML fragments then.
    I'm surprised you say the query alone works.
    We cannot build an XMLType instance using the default constructor or createXML() method when the content is composed of fragments.
    AFAIK the only option is to use XMLParse() with CONTENT option :
    SQL> select xmltype.createxml(LOG_MSG) from TSS_SRM_CBEBRE_LOGS_V;
    ERROR:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00245: extra data after end of document
    Error at line 2
    ORA-06512: at "SYS.XMLTYPE", line 5
    no rows selected
    SQL> select xmltype(LOG_MSG) from TSS_SRM_CBEBRE_LOGS_V;
    ERROR:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00245: extra data after end of document
    Error at line 2
    ORA-06512: at "SYS.XMLTYPE", line 272
    ORA-06512: at line 1
    no rows selected
    SQL> select xmlparse(content LOG_MSG) from TSS_SRM_CBEBRE_LOGS_V;
    XMLPARSE(CONTENTLOG_MSG)
    <a attr1="1" attr2="2" />
    <b attr1="3" attr2="4" />
    <c attr1="5">
    <e attr1="6" a
    Anyway, you'll eventually hit this :
    SQL> insert into testme (LOG_MSG)
      2  select XMLparse(content LOG_MSG)
      3  from TSS_SRM_CBEBRE_LOGS_V;
    insert into testme (LOG_MSG)
    ERROR at line 1:
    ORA-19010: Cannot insert XML fragments

  • Extracting xmltype from table into xml output:  redundant nodes

    Hi guys - see the below example.  (edit:   sorry, haven't used these forums for a while and can't seem to figure out how to format code.....)
    [code]SQL> select *
      2    from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    PL/SQL Release 11.2.0.4.0 - Production
    CORE    11.2.0.4.0      Production
    TNS for Linux: Version 11.2.0.4.0 - Production
    NLSRTL Version 11.2.0.4.0 - Production
    [/code]
    [/code]
    SQL> create table mytesttable (item_id number, x_data xmltype);
    Table created.
    SQL>
    SQL> insert into mytesttable
      2  with dat as (select 'blah' item from dual
      3               union all
      4               select 'more blah' from dual)
      5  ,t as (select xmlelement("x_data"
      6                              ,xmlattributes(1 as "dummyattr")
      7                              ,xmlagg(xmlelement("item"
      8                                                ,item))
      9                              ) x_data
    10              from dat
    11              )
    12  select 1,x_data
    13    from t    ;
    1 row created.
    SQL>
    SQL> select *
      2    from mytesttable;
       ITEM_ID
    X_DATA
             1
    <x_data dummyattr="1">
      <item>blah</item>
      <item>more blah</item>
    </x_data>
    1 row selected.
    SQL>
    SQL> select xmlelement("outerelement"
      2                   ,xmlelement("itemID", item_id)
      3                   ,xmlelement("x_data",x_data)
      4                   )
      5     from mytesttable;
    XMLELEMENT("OUTERELEMENT",XMLELEMENT("ITEMID",ITEM_ID),XMLELEMENT("X_DATA",X_DATA))
    <outerelement><itemID>1</itemID><x_data><x_data dummyattr="1">
    <item>blah</item>
    <item>more blah</item>
    </x_data>
    </x_data></outerelement>
    1 row selected.
    [/code]
    As the above, I have an xmltype in a table which has other non-xmltype columns.   I have a requirement to extract them out into a single xml document in a similar way to the last SQL there.
    the problem is if I do it as per the above, I artificially add a redundant node.  the first <x_data> node is not necessary, but how do I go and add the xmltype column to the result without having to qualify it with another element around it?
    i.e. how do I get the following:
    <outerelement><itemID>1</itemID><x_data dummyattr="1">
    <item>blah</item>
    <item>more blah</item>
    </x_data></outerelement>

    nevermind.. I was having a dumb moment:
    select xmlelement("outerelement"
                     ,xmlelement("itemID", item_id)
                     ,x_data
       from mytesttable;

  • Upsert of xmltype from given xpath - missing something obvious?

    Version: 10.2.0.*2* EE
    I am trying to do an upsert (update/ insert ) of an xmltype for a given xpath.
    The xml data is being passed as an xmltype, the xpath is a string (varchar2), the new value is a string, varchar2.
    If the node specified by the xpath exists this is trivial using updatexml; of course if the node doesn't exist nothing happens. I can check for the nodes existence using exists node, but I'm coming unstuck trying to figure out how to insert the node.
    All the APIS I can find that insert XML (APPENDCHILDXML,INSERTXMLBEFORE, INSERTCHILDXML) do not take an xpath but require an xmltype. Which means if I am reading this right I have no choice but to parse the xpath varchar2 string to try and construct an xmltype (ugh!).
    I can't find any API that just takes an xpath as a varchar2 and a value and gives me an xmltype. Ideally I don't even want that, would just like an API that returns the updated XML which has either had the xpath updated (or inserted if it didn't exist) with the new value.
    I am not an XML expert but I am pretty handy with SQL and PL/SQL. To me this just seems incredibly cumbersome just to do something as trivial as an upsert, so I am hoping I am missing something obvious!
    Can soemone please set me straight with a pointer or example?
    To top it all off the XML uses namespaces, but they aren't registered, there is no schema registration going on.

    Marco Gralike wrote:
    Couldn't it be done via XQuery, although the database version doesn't really help...That would be possible with a dynamic XQuery expression, but "painful" with a static expression as it would require parsing the XPath, and rebuilding the entire input document with the required modifications.
    I think XSLT would be more efficient in this case.
    Maybe, one day, when the database has XQuery Update Facility, we will be able to do this :
    copy $a := $doc/Address
    modify (
      if ($a/zip)
        then replace value of node $a/zip with "12345"
        else insert node element zip {"12345"} into $a
    return $a
    user12083137 wrote:To me, from a SQL background, I can't believe this simple case is simply not covered.Maybe not as simple as it seems. :)
    The functionality can be simulated via an IF/THEN/ELSE logic, or a DELETE/INSERT sequence.
    For example :
    case when existsNode(doc, xpath) = 1
      then updateXML(
             doc
           , xpath || '/text()'
           , somevalue
      else appendchildxml(
             doc
           , substr(xpath, 1, instr(xpath, '/', -1)-1)
           , xmlelement(
               evalname(substr(xpath, instr(xpath, '/', -1)+1))
             , somevalue
    endor,
    appendChildXML(
      deleteXML(doc, xpath)
    , substr(xpath, 1, instr(xpath, '/', -1)-1)
    , xmlelement(
        evalname(substr(xpath, instr(xpath, '/', -1)+1))
      , somevalue
    )

  • SQLException "Expected 'EOF'" when extracting XMLType from ResultSet

    Hi,
    I am trying to implement a Java method that returns the nodes matching a given xpath expression. The query is working fine and the code is mostly working. The problem is getting the information out of an XmlType in Java.
    The query is as follows:
    ---8&lt;--
    select extract(res, '/xdb:Resource/xdb:Contents'||:xpath,
    'xmlns:xdb="http://xmlns.oracle.com/xdb/XDBResource.xsd" '||:ns) node
    from resource_view
    where under_path(res, :path) = 1;
    ---8&lt;--
    xpath = '//n:PostalCode'
    ns = 'xmlns:n="uri:cosmos:schema:company:1.0"'
    path = '/home/contactmgr'
    And the Java code:
    ---8&lt;---
    resultSet = statement.executeQuery();
    while (resultSet.next())
    OPAQUE opaque = (OPAQUE) resultSet.getObject(1);
    if (opaque != null)
    XMLType myNode = XMLType.createXML(opaque);
    String testString = myNode.getStringVal();
    Document testDocument = myNode.getDOM();
    ---8&lt;---
    The testString contains the expected result (messy, but workable), i.e. "&lt;PostalCode xmlns="uri:cosmos:schema:company:1.0"&gt;GU1 4LY&lt;/PostalCode&gt;\n&lt;PostalCode xmlns="uri:cosmos:schema:company:1.0"&gt;TW18 4AQ&lt;/PostalCode&gt;\n". These are the two postal codes in the first document.
    The call to myNode.getDOM() fails with an SQLException and a message of "Expected 'EOF'".
    I appreciate that the returned xml is a fragment and as such it shouldn't be possible to return an org.w3c.dom.Document instance. However, when I try using myNode.getDocumentFragment() I still get an SQLException but with no message or any other details.
    The method is currently expected to return a list of Nodes.
    Any ideas?

    The Oracle 10G XDB Developers Guide (http://download-west.oracle.com/docs/cd/B13789_01/appdev.101/b10790/xdb03usg.htm#sthref209) offers the following:
    "The extract() function returns the node or nodes that match the XPath expression. Nodes are returned as an instance of XMLType. The results of extract() can be either a document or DocumentFragment."
    To provide for the fact that an XPath expression may match multiple nodes in any given document, I modified the query to use xmlsequence(). This should then return an array of XmlType instances.
    --8<--
    select xmlsequence(extract(res, '/xdb:Resource/xdb:Contents'||?,
    'xmlns:xdb="http://xmlns.oracle.com/xdb/XDBResource.xsd"
    '||?)) nodes
    from resource_view
    where under_path(res, ?) = 1;
    --8<--
    The Java JDBC code then looks like this:
    --8<--
    OPAQUE[] myRawNodes = (OPAQUE[]) myResultSet.getArray(1).getArray();
    for (int i = 0; i < myRawNodes.length; i++)
    OPAQUE myOpaque = (OPAQUE) myRawNodes[ i ];
    if (myOpaque != null)
    XMLType myNode = XMLType.createXML(myOpaque);
    myCollection.add(myNode.getDOM());
    --8<--
    Testing this out however, I get the following exception:
    java.sql.SQLException: Internal Error: makeJavaArray doesn't support type 2007
    To re-iterate: my goal is to:
    a) evaluate an XPath expression that will return a list of nodes against all the documents under a particular path in the resource_view;
    b) extract all the returned nodes using JDBC; and
    c) return the collection of nodes to the caller.
    Any ideas?

  • Attempt to read XMLType from Oracle 11G

    Hi.
    I try to read XMLtype field from Oracle11G next way:
    import java.io.InputStream;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import oracle.xdb.XMLType;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import oracle.jdbc.driver.OraclePreparedStatement;
    public class test_XMLType {
    public static DocumentBuilder loader;
    public static Transformer transformer;
    public static DocumentBuilderFactory factory,factory_o;
    public static Document d,o;
    public static NodeList nl;
    public static Element el;
    public static int regim=0;
    public static String OS_command;
    public static String result_command="";
    public static String name_element="";
    public static String SID ="orcl";
    public static String pwd ="oracle";
    public static String user="monit";
    public static String port ="1521";
    public static String connect_string ="";
    public static String host ="localhost";
    public static String connect_string1 = "jdbc:oracle:thin:";
    // public static InputSource scen = new InputSource();
    public static XMLType scen;
    // public static CLOB scen;
    public static OracleCallableStatement proc = null;
    public static String this_host ="host1";
    public static Connection conn;
    public static InputStream xmlStream;
    // public static XMLscen XmlType;
    public test_XMLType() {
    super();
    public static String GetCommand() {
    // reading XML scenary from moniroring server
    try {
    connect_string =connect_string1 + user + "/" + pwd + "@" + host + ":" + port + ":" + SID;
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    conn = DriverManager.getConnection(connect_string);
    OracleCallableStatement proc = (OracleCallableStatement)conn.prepareCall("select SCENARY from scenaries where host_name = ?");
    // OracleCallableStatement proc = (OracleCallableStatement)conn.prepareCall("select TEST from scenaries where host_name = ?");
    proc.setString(1, this_host);
    OracleResultSet rs = (OracleResultSet)proc.executeQuery();
    rs.next();
    System.out.println(rs.getOPAQUE("SCENARY").getSQLTypeName());
    scen = XMLType.createXML(rs.getOPAQUE("SCENARY"));
    // System.out.println(XMLType.createXML(rs.getOPAQUE("SCENARY")));
    // InputStream xmlStream = scen.getStream();
    // System.out.println(rs.getString("test"));
    proc.close();
    catch (Exception e) {
    e.printStackTrace();
    return "Ok";
    I got next error in JDeveloper runnig window
    E:\Middleware\jdk160_18\bin\javaw.exe -client -classpath C:\JDeveloper\mywork\Application_test_XMLType\.adf;C:\JDeveloper\mywork\Application_test_XMLType\Client\classes;E:\app\sys\product\11.2.0\dbhome_2\oui\jlib\classes12.jar;E:\app\sys\product\11.2.0\dbhome_2\RDBMS\jlib\xdb.jar;E:\app\sys\product\11.2.0\dbhome_2\oui\jlib;E:\app\sys\product\11.2.0\dbhome_2\RDBMS\jlib -Djavax.net.ssl.trustStore=E:\Middleware\wlserver_10.3\server\lib\DemoTrust.jks client.test_XMLType
    SYS.XMLTYPE
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/xml/binxml/BinXMLException
         at client.test_XMLType.GetCommand(test_XMLType.java:118)
         at client.test_XMLType.main(test_XMLType.java:138)
    Caused by: java.lang.ClassNotFoundException: oracle.xml.binxml.BinXMLException
         at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
         ... 2 more
    Process exited with exit code 1.
    But using SQLDeveloper I get this field without any problems.
    Thanks in advance for reply.
    Andrii.

    Thanks for reply. A have added xmlparsev2.jar library and got next
    E:\Middleware\jdk160_18\bin\javaw.exe -client -classpath C:\JDeveloper\mywork\Application_test_XMLType\.adf;C:\JDeveloper\mywork\Application_test_XMLType\Client\classes;E:\app\sys\product\11.2.0\dbhome_2\oui\jlib\classes12.jar;E:\app\sys\product\11.2.0\dbhome_2\RDBMS\jlib\xdb.jar;E:\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;E:\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xml.jar;E:\app\sys\product\11.2.0\dbhome_2\oui\jlib;E:\app\sys\product\11.2.0\dbhome_2\RDBMS\jlib -Djavax.net.ssl.trustStore=E:\Middleware\wlserver_10.3\server\lib\DemoTrust.jks client.test_XMLType
    SYS.XMLTYPE
    Exception in thread "main" java.lang.NoSuchMethodError: oracle.jdbc.OracleConnection.physicalConnectionWithin()Loracle/jdbc/internal/OracleConnection;
         at oracle.xdb.XMLType.initConn(XMLType.java:3673)
         at oracle.xdb.XMLType.<init>(XMLType.java:1358)
         at oracle.xdb.XMLType.createXML(XMLType.java:821)
         at oracle.xdb.XMLType.createXML(XMLType.java:799)
         at client.test_XMLType.GetCommand(test_XMLType.java:118)
         at client.test_XMLType.main(test_XMLType.java:138)
    Process exited with exit code 1.

  • Retrieve XMLtype from php

    Hello,
    I'm trying to load data to my table.
    $ora_conn = ocilogon("user", "passwd", "orcl");
    $xml = '<xm>...</xml>';
    $sql = "INSERT INTO test VALUES(1111, sys.xmltype.createxml(:rec))";
    $stmt = OCIParse($ora_conn,$sql);
    $clob = OCINewDescriptor($ora_conn, OCI_D_LOB);
    $rowid = OCINewDescriptor($ora_conn,OCI_D_ROWID);
    OCIBindByName($stmt, ':rec', &$clob, -1,OCI_B_CLOB);
    $clob->WriteTemporary($xml,OCI_TEMP_CLOB);
    $success = OCIExecute($stmt,OCI_DEFAULT);
    if($success) {
    OCICommit($ora_conn);
    OCIFreeStatement($stmt);
    OCIFreeDesc($lob);
    using this I can insert large XML documents. But when I try to retrieve them from PHP i can't. Ive tried an ocifetch into and an ocifetch...
    $ora_conn = ocilogon("stefan", "geheim", "orcl");
    $sql = "select record from test";
    $stmt = OCIParse($ora_conn,$sql);
    OCIExecute($stmt,OCI_DEFAULT);
    while(OCIFetchInto($stmt, $arr, OCI_ASSOC))
    //output
    this generates an string literal too long error. And an normal ocifetch can't get more then 2000 chars. How can I get my data to PHP
    Hope someone can help me out..
    Thanks in advance..
    Greetings Stefan.

    If you're loading your SWF from one server, and contacting
    another server,
    you need place the crossdomain.xml file on the other server
    from which you're
    requesting data, typically in the webroot.
    That is, if you're trying to contact "
    http://server/docroot/pages/php/request.php"
    then you'd need to have a crossdomain.xml file at "
    http://server/crossdomain.xml".
    This crossdomain.xml policy file must include the domain from
    which your
    SWF was loaded in order for it to be allowed to contact this
    domain.
    Hello arpiyem,
    > hi, i just uploaded to our remote host the files with
    php and flex
    > combination. here on my local computer, i was able to
    retrieve data
    > using my local database, i also tried to connect from my
    local using a
    > remote database. but when i uploaded the files, and
    tried to connect
    > to a red hat linux host i think, i cant make it to work.
    i can see the
    > interface but no data was retrieve. i googled some
    possible options
    > and used crossdomain, but still cant get it to work. im,
    by the way,
    > new to flex and would like to explore this great
    technology. i was
    > thinking the my tags in <mx:HTTPService> were
    incorrect, i have
    > url="
    http://server/docroot/pages/php/request.php",
    i also tried
    > url="php/request.php", but still failed to retrieve the
    > information.hope u can help me guys. thank you in
    advance.
    >

  • Calling procedure PL/SQL from OCCI passing objects

    Hi all!
    I need a sample from a OCCI program that call a stored pl/sql procedure and pass an IN OUT parameter of type object.
    Thanks in advanced!

    I don't remember how after all these years, but I remember that I made a native Informix call in a special way. So it seems logical that you should be able to do the same for Oracle...
    Scott

  • Segmentation fault when calling dbms_alert.register() procedure from OCCI

    I am trying to call the dbms_alert.register() from the OCCI but I get segmentation fault when I run the program, here is the code snippet. I am gettin segmentation fault immediately after calling setSQL() method.
    Environment *occiEnvironment_;
    Connection *occiConnection_ ;
    string userName("SCOTT");
    string userPasswd("tiger");
    string url("");
    occiEnvironment_ = Environment::createEnvironment();
    try{
    occiConnection_ = occiEnvironment_->createConnection(userName,userPasswd,url);
    Statement *occiStatement1;
    cout << "Before setSQL" << endl;
    occiStatement1->setSQL("BEGIN dbms_alert.register(:1); END;");
    cout << "After setSQL" << endl;
    string alert1("MY_ALERT");
    occiStatement1->setString(1,alert1);
    occiStatement1->execute();
    catch (SQLException ea)
    cout << ea.what();
    }

    Thanks for the reply, now I dont see segmentation fault.
    I tried to exted the code further to wait for the registered events, I added the following code, I do get and event but then get the exception:
    Statement *occiStatement1 = occiConnection_->createStatement();
    Statement *occiStatement2 = occiConnection_->createStatement();
    string alert, msg;
    int status;
    occiStatement1->setSQL("BEGIN dbms_alert.register(:1); END;");
    string alert1("MY_ALERT");
    occiStatement1->setString(1,alert1);
    occiStatement1->execute();
    occiStatement2->setSQL("BEGIN dbms_alert.waitany(:alert,:msg,:status); END;");
    occiStatement2->registerOutParam(1, OCCICHAR, sizeof(alert));
    occiStatement2->registerOutParam(2, OCCICHAR, sizeof(msg));
    occiStatement2->registerOutParam(3, OCCIINT, sizeof(int));
    occiStatement2->execute();
    ===========================================================
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.DBMS_ALERT", line 252
    ORA-06512: at line 1
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.DBMS_ALERT", line 252
    ORA-06512: at line 1
    *** glibc detected *** free(): invalid pointer: 0x08619c48 ***
    Aborted

  • Page not found error when accesing Portal from Internet

    Hi,
    I'm getting the following error message when accessing Portal as administrator from the Internet:
    The page cannot be displayed 
    Explanation: There is a problem with the page you are trying to reach and it cannot be displayed.
    Try the following:
    Refresh page: Search for the page again by clicking the Refresh button. The timeout may have occurred due to Internet congestion.
    Check spelling: Check that you typed the Web page address correctly. The address may have been mistyped.
    Access from a link: If there is a link to the page you are looking for, try accessing the page from that link.
    Technical Information (for support personnel)
    Error Code: 500 Internal Server Error. The request was rejected by the HTTP filter. Contact the server administrator. (12217)
    The error message shows in the rightmost area of the browser.
    In the left area I can see the Portal Content
    This happens when using Internet Explorer 6, windows XP, sp2.
    When using MozillaFirefox, the error won't show up, but I don't have full functionality when trying for example to right-click to create Systems in the SystemLandscape window....
    To access Portal from internet, I simply go to http://company.com:50000/irj
    Server side Portal installations is as follows:
    EP7, SP11, windows 2003 64bits.
    Any help will be appreciated.
    Regards.

    Hi Claudio Roca,
    I have encountered the same problem. Do you found the solution for this issue? I will much appreciated if you willing to share your solution and email to [email protected] Thank you so much.
    Regards,
    Hau Chee

Maybe you are looking for

  • Itunes doesn't see all the data on all my albums

    I'm not sure if it's something I'm doing wrong, or what. I've got about 10GB of MP3's on my computer, when I open them on Windows Media Player or windows explorer I see all the info; album, artist, genre, everything, for all my files. when I add the

  • MRP Run Back ground

    Hi Experts, We are running the MRP for every monday with using t.code: MD01, client required that background job for MRP run. Any one suggest how we run the MRP background and proivde the pogramme name and process. Thank you. Hanuman

  • Share folio with someone in China

    Hello, I've made a folio in Belgium, which I am now trying to share with some one in China, via the Adobe Content Viewer. When they log in in the Content Viewer, they get no download invitation, nothing at all. I've allready tried loggin in at my end

  • Need assistance editing a scanned document

    I am trying to edit a scanned document however it keeps saying it is to large.  My page is 36x24 and it wants me to crop it but I can't I will lose important information.  Any help would be appreciated.

  • Detach citadel database to move

    Hi, I'm upgrading the computer I use for datalogging. I want to move my citadel database over. Ive tried following the intrucctions here: http://digital.ni.com/public.nsf/allkb/2B0C74744BB37391862571F500067C64 , but when I go to Detach the database,