SQL Statements in XML

Folks
I need to separate SQL statements from Java Code, How do i put these SQL Statements in an XML file and how to access these SQL statements from a Java code,
Any help with sample code is greatful,
thanks
mathew

I looked it and they support only Perl now, Infact i saw some questions posted in some forums about having SQL statements in XML, but i am not able to get that information,Let me know if you can get any information,
thanks
KM

Similar Messages

  • SQL statements in XML File

    Folks
    I need to separate SQL statements from Java Code, How do i put these SQL Statements in an XML file and how to access these SQL statements from a Java code,
    Any help with sample code is greatful,

    The use of entities as kstc_jyu may help. It really depends on how you design the XML vocabulary based on the expected usage (e.g., if the SQL statements change very often).
    Back to the original question, I am right to interpret "how to use SQL statements in XML ?" as how to design an XML vocabulary to store SQL statements?
    If not, you can simply use the scheme proposed by DrClap. Reading and extracting the SQL statement would be just as you would with any other XML document. Google for a Java XML tutorial.

  • Java executed SQL statement to XML - large number of rows

    Hello,
    I have to write some code to generate XML as the result of a query. AFAIK I am using the latest versions of the relevant Java libraries etc.
    I have found that using a max_size function above 2000 results in 'Exception in thread "main" java.lang.OutOfMemoryError' errors
    I thought I could overcome this by reading the data in batches using the skip_rows functionality.
    I have included the code I am using below and would appreciate any help.
    Best Regards,
    Mark Robbins
    import java.sql.*;
    import java.math.*;
    import oracle.xml.sql.query.*;
    import oracle.xml.sql.docgen.*;
    import oracle.jdbc.*;
    import oracle.jdbc.driver.*;
    public class XMLRetr
    public static void main(String args[]) throws SQLException
    String tabName = "becc";
    String user = "test/test";
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    //initiate a JDBC connection
    Connection conn =
    DriverManager.getConnection("jdbc:oracle:oci8:"+user+"@test");
    // initialize the OracleXMLQuery
    OracleXMLQuery qry = new OracleXMLQuery(conn,"select * from "+tabName+" where TRUNC(SAMPLED) < \'14-NOV-99\'" );
    // structure the generated XML document
    System.out.println("Before setting parameters");
    qry.setMaxRows(8000); // set the maximum number of rows to be returned
    qry.setRowsetTag("ROOTDOC"); // set the root document tag
    qry.setRowTag("DBROW"); // sets the row separator tag
    qry.setRaiseException(true);
    qry.keepCursorState(true);
    // create the document generation factory. Note: there are methods in OracleXMLQuery
    // which don't require that an OracleXMLDocGen object be passed in; but rather, they
    // create an OracleXMLDocGen object of their own.
    OracleXMLDocGen doc = (OracleXMLDocGen) new OracleXMLDocGenString();
    for (int rowCnt = 1; rowCnt < 8000; rowCnt = rowCnt + 1000)
    // get the xml
    System.out.println("Before skip rowCnt:"+rowCnt);
    qry.setSkipRows(rowCnt); // process next batch
    System.out.println("Before getXML");
    // this is where I get the exception on the second iteration of the loop
    qry.getXML(doc);
    System.out.println("Displaying document");
    // System.out.println(doc.getXMLDocumentString());
    System.out.println("Row number:"+rowCnt);
    System.out.flush();
    System.out.println("End of document");
    qry.close();
    null

    I used qry.getXMLString()
    But called it for every row, ie, set
    qry.maxRows(1) and qry.skipRows(rowcount-1).
    The down side is I had to postprocess the String to remove the processing instruction and doc level tags.

  • Call an sql insert statement in xml publisher

    Hi to all,
    i've a question as regard xml publisher.
    Sorry but i don't have a lot of time to look around.
    This features is quite important and probably would determine if we will use this
    product or not.
    Is possible to call an sql statement when the output is generated?
    example: a user call a report with some par to filter the output (some select list / text, ecc..)
    Or generally can i call use a pl/sql block instead of pl/sql query to populate and at
    the same time to write other data to keep track of the printing / generation of the
    documents X user?
    Otherwise, is xml publisher writing this info in some system table of xml publ?
    Note: i use most of all pl/sql and htmldb and i don't want to use other programming languages until this app is finished.
    Thank you very very much.

    Hi Marcello
    I seem to remember from other threads that you are assessing the enterprise edition of XMLP right?
    If you use the data templates to define how the data should be extracted then you can call a plsql pkg after the fetch to update/insert to your hearts content.
    Otherwise you could use the APIs instead of the UI to do the same or even build an extension to the RTF templates to make the sql call ... we do not document this at the moment but its possible.
    Regards
    Tim

  • Using sql function in xml sql statement

    Hello,
    I have following statement:
    select field1, field2,....,field10 from table( cast (get_mhdata(:1,:2) as mhdata))
    where mhdata is an oracle type with 10 fields.
    It works good, but I don't know how can I use this statement in xml sql statement.
    Please, can you tell me if it is really possible.
    Thanks in regards.

    Hi
    You cant pass the parameters if you are executing writing this select function from the communication channel.
    You have 3 options:
    1) Use a stored procedure and execute from the communication channel
    2) Use a stored procedure and execute via message mapping in the IR - here you can pass parameters
    3) Same as above but call the query via SQL select - you can also pass parameters.
    sincerely,
    --NM

  • How to parsing xml data in sql statement??

    Hi friends, I have a table which contain column as clob ,stores in xml format, for example my column contain xml data like this
    <Employees xmlns="http://TargetNamespace.com/read_emp">
       <C1>106</C1>
       <C2>Harish</C2>
       <C3>1998-05-12</C3>
       <C4>HR</C4>
       <C5>1600</C5>
       <C6>10</C6>
    </Employees>
      Then how to extract the data in above xml column data using SQL statement...

    Duplicate post
    How to parsing xml data in sql statement??

  • XML Publisher - can we specify multiple SQL statements in the report?

    Hi there,
    can we specify multiple SQL statements in the report with XML Publisher?
    Regards,
    Liviu

    Could we eventually generate with the Wizards available in XML Publisher desktop 5.6.2 an xml file with a structure like the one given below? The reason is to facilitate creation of the two rowsets. Thanks, Liviu.
    <?xml version="1.0" encoding="UTF-8"?>
    <DATA>
         <ROWSET2>
              <ROW2>
                   <FIELD1>Query1</FIELD1>
                   <FIELD2>field2</FIELD2>
                   <FIELD3>field3</FIELD3>
              </ROW2>
         </ROWSET2>
         <ROWSET>
              <ROW>
                   <FIELD1>Query2</FIELD1>
                   <FIELD2>field2</FIELD2>
                   <FIELD3>field3</FIELD3>
              </ROW>
         </ROWSET>
    </DATA>

  • How to use alternative sql statements in ejb 2.0

    hi
    i have written the alternative sql statement in persistence.xml like  "select max(modifieddate) from tmp_dlv_mgmt".
    i am getting the error
    java.rmi.RemoteException: com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method in.kgs.bean.Dlv_EntityHomeImpl0.findMaxModifiedByUserID(java.lang.String).
         at in.kgs.bean.Dlv_EntityHomeImpl0.findMaxModifiedByUserID(Dlv_EntityHomeImpl0.java:1477)
         at in.kgs.bean.Dlv_EntityHomeImpl0p4_Skel.dispatch(Dlv_EntityHomeImpl0p4_Skel.java:387)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.engine.services.ejb.exceptions.BaseEJBException: Exception in method Dlv_EntityBean0.FindMaxModifiedByUserID(java.lang.String).
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:900)
         at in.kgs.bean.Dlv_EntityHomeImpl0.findMaxModifiedByUserID(Dlv_EntityHomeImpl0.java:1449)
         ... 10 more
    Caused by: com.sap.sql.log.OpenSQLException: A column with name DLVNO is unknown.
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
         at com.sap.sql.jdbc.common.CommonResultSet.findColumn(CommonResultSet.java:643)
         at com.sap.sql.jdbc.common.CommonResultSet.getLong(CommonResultSet.java:382)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPK(Dlv_EntityBean0Persistent.java:213)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPrimaryKey(Dlv_EntityBean0Persistent.java:206)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractSinglePK(FindPKCollection.java:152)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractAndAddSinglePK(FindPKCollection.java:167)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.onlyLoadAllElementsFromRS(FindPKCollection.java:146)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.forceLoadingOfAllElementsFromRS(FindPKCollection.java:128)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.<init>(FindPKCollection.java:99)
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:896)
         ... 11 more
    ; nested exception is:
         javax.ejb.EJBException: com.sap.engine.services.ejb.exceptions.BaseEJBException: Exception in method Dlv_EntityBean0.FindMaxModifiedByUserID(java.lang.String).
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:900)
         at in.kgs.bean.Dlv_EntityHomeImpl0.findMaxModifiedByUserID(Dlv_EntityHomeImpl0.java:1449)
         at in.kgs.bean.Dlv_EntityHomeImpl0p4_Skel.dispatch(Dlv_EntityHomeImpl0p4_Skel.java:387)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.sql.log.OpenSQLException: A column with name DLVNO is unknown.
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
         at com.sap.sql.jdbc.common.CommonResultSet.findColumn(CommonResultSet.java:643)
         at com.sap.sql.jdbc.common.CommonResultSet.getLong(CommonResultSet.java:382)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPK(Dlv_EntityBean0Persistent.java:213)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPrimaryKey(Dlv_EntityBean0Persistent.java:206)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractSinglePK(FindPKCollection.java:152)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractAndAddSinglePK(FindPKCollection.java:167)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.onlyLoadAllElementsFromRS(FindPKCollection.java:146)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.forceLoadingOfAllElementsFromRS(FindPKCollection.java:128)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.<init>(FindPKCollection.java:99)
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:896)
         ... 11 more
    com.sap.sql.log.OpenSQLException: A column with name DLVNO is unknown.
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
         at com.sap.sql.jdbc.common.CommonResultSet.findColumn(CommonResultSet.java:643)
         at com.sap.sql.jdbc.common.CommonResultSet.getLong(CommonResultSet.java:382)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPK(Dlv_EntityBean0Persistent.java:213)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPrimaryKey(Dlv_EntityBean0Persistent.java:206)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractSinglePK(FindPKCollection.java:152)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractAndAddSinglePK(FindPKCollection.java:167)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.onlyLoadAllElementsFromRS(FindPKCollection.java:146)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.forceLoadingOfAllElementsFromRS(FindPKCollection.java:128)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.<init>(FindPKCollection.java:99)
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:896)
         at in.kgs.bean.Dlv_EntityHomeImpl0.findMaxModifiedByUserID(Dlv_EntityHomeImpl0.java:1449)
         at in.kgs.bean.Dlv_EntityHomeImpl0p4_Skel.dispatch(Dlv_EntityHomeImpl0p4_Skel.java:387)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
         at com.sap.engine.services.ejb.exceptions.BaseRemoteException.writeReplace(BaseRemoteException.java:276)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:896)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1011)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
         at com.sap.engine.services.rmi_p4.DispatchImpl.throwException(DispatchImpl.java:144)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:322)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: javax.ejb.EJBException: com.sap.engine.services.ejb.exceptions.BaseEJBException: Exception in method Dlv_EntityBean0.FindMaxModifiedByUserID(java.lang.String).
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:900)
         at in.kgs.bean.Dlv_EntityHomeImpl0.findMaxModifiedByUserID(Dlv_EntityHomeImpl0.java:1449)
         at in.kgs.bean.Dlv_EntityHomeImpl0p4_Skel.dispatch(Dlv_EntityHomeImpl0p4_Skel.java:387)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.sql.log.OpenSQLException: A column with name DLVNO is unknown.
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
         at com.sap.sql.jdbc.common.CommonResultSet.findColumn(CommonResultSet.java:643)
         at com.sap.sql.jdbc.common.CommonResultSet.getLong(CommonResultSet.java:382)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPK(Dlv_EntityBean0Persistent.java:213)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPrimaryKey(Dlv_EntityBean0Persistent.java:206)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractSinglePK(FindPKCollection.java:152)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractAndAddSinglePK(FindPKCollection.java:167)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.onlyLoadAllElementsFromRS(FindPKCollection.java:146)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.forceLoadingOfAllElementsFromRS(FindPKCollection.java:128)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.<init>(FindPKCollection.java:99)
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:896)
         ... 11 more
    com.sap.sql.log.OpenSQLException: A column with name DLVNO is unknown.
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
         at com.sap.sql.jdbc.common.CommonResultSet.findColumn(CommonResultSet.java:643)
         at com.sap.sql.jdbc.common.CommonResultSet.getLong(CommonResultSet.java:382)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPK(Dlv_EntityBean0Persistent.java:213)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPrimaryKey(Dlv_EntityBean0Persistent.java:206)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractSinglePK(FindPKCollection.java:152)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractAndAddSinglePK(FindPKCollection.java:167)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.onlyLoadAllElementsFromRS(FindPKCollection.java:146)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.forceLoadingOfAllElementsFromRS(FindPKCollection.java:128)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.<init>(FindPKCollection.java:99)
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:896)
         at in.kgs.bean.Dlv_EntityHomeImpl0.findMaxModifiedByUserID(Dlv_EntityHomeImpl0.java:1449)
         at in.kgs.bean.Dlv_EntityHomeImpl0p4_Skel.dispatch(Dlv_EntityHomeImpl0p4_Skel.java:387)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
         at com.sap.engine.services.ejb.exceptions.BaseEJBException.writeReplace(BaseEJBException.java:274)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:896)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1011)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
         ... 11 more

    Hi Guruvulu,
    >
    Guruvulu Bojja wrote:
    > i have written the alternative sql statement in persistence.xml like  "select max(modifieddate) from tmp_dlv_mgmt".
    Could you please explain in detail - what you have done and what you want to achieve? You can also post the code of your persistence.xml for reference...
    Regards,
    Yordan

  • How to use Native SQL statement in JDBC receiver interface

    Dear All,
    Can any one please help us in using Native SQL statement in a JDBC receiver channel. The reason why I need to use Native SQL statement instead of standard XML structure is that I need to execute a dynamic SQL query in third party database system lke:-
    Select Field1 Field2 from TABLE Where Field3 like "%Name'
    I expect the the response in the form of XML file which I can pick up using synchornous interface as mentioned on help.sap.com:-
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    The value for %Name can change dynamically according to the transaction and hence cannot be inluded as a KEY element in standard XLM structure,
    Hence I need to know:-
    1. What message mapping I should use in case if I have to use Native SQL statement.
    2.What operation mapping I should use in case if I have to use Native SQL statement.
    If guess correclty I may have to use Java mapping to do the above activities. Hence I want to know
    3 .How do to go about it to do the Java mapping.
    Thanks
    Ameet

    >
    Ameet Deshpande wrote:
    > Dear All,
    >
    > Can any one please help us in using Native SQL statement in a JDBC receiver channel. The reason why I need to use Native SQL statement instead of standard XML structure is that I need to execute a dynamic SQL query in third party database system lke:-
    >
    > "
    > Select Field1 Field2 from TABLE Where Field3 like "%Name'
    > "
    > I expect the the response in the form of XML file which I can pick up using synchornous interface as mentioned on help.sap.com:-
    >
    > http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    > http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    >
    > The value for %Name can change dynamically according to the transaction and hence cannot be inluded as a KEY element in standard XLM structure,
    >
    > Hence I need to know:-
    >
    > 1. What message mapping I should use in case if I have to use Native SQL statement.
    > 2.What operation mapping I should use in case if I have to use Native SQL statement.
    > If guess correclty I may have to use Java mapping to do the above activities. Hence I want to know
    > 3 .How do to go about it to do the Java mapping.
    >
    > Thanks
    > Ameet
    You can use a stored procedure, and call it from jdbc receiver adapter.
    I also solve this issue, with a DBLookup in message mapping. You can refer to my blog, and this usefull 3d:
    http://simonlesflex.wordpress.com/2010/12/07/pi-oracle-dblookup/
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler

  • How to Retrieve SQL Statements in RDF Reports

    I need to retrieve the SQL statements from my reports without having to call each of them up in Reports Builder. The reports are in binary (RDF format). Does anyone know of a way to do this?

    Hello,
    Convert your RDF into a text format :
    - REX
    - XML/HTML/JSP if your are using Reports 9.0.x or greater)
    and search in these text files .
    Regards

  • Add string  in sql statement

    hi
    i want to add one string in a output of the sqlstatemnt.below is my sql statement
    select
    XMLELEMENT ("DATABASE_OBJECTS",xmlagg(
    XMLFOREST (owner,
    object_type,
    object_name,
    object_user_name,
    physical_name
    ).getClobVal()
    FROM xxhex_custom_objects;
    the string whic i want to add in output is:
    '<?xml version="1.0" encoding="UTF-8"?>'.
    i tried the below query but it is giving me an error.
    select '<?xml version="1.0" encoding="UTF-8"?>',
    XMLELEMENT ("DATABASE_OBJECTS",xmlagg(
    XMLFOREST (owner,
    object_type,
    object_name,
    object_user_name,
    physical_name
    ).getClobVal()
    FROM xxhex_custom_objects;

    >
    i want to add one string in a output of the sqlstatemnt.below is my sql statement
    select
    XMLELEMENT ("DATABASE_OBJECTS",xmlagg(
    XMLFOREST (owner,
    object_type,
    object_name,
    object_user_name,
    physical_name
    ).getClobVal()
    FROM xxhex_custom_objects;
    the string whic i want to add in output is:
    '<?xml version="1.0" encoding="UTF-8"?>'.
    >
    Unless the result of your XMLELEMENT query is valid XML adding that string won't accomplish anything. The result will NOT be valid XML.
    See my replies in this thread
    Re: expression must have same datatype
    If your query result is a string then you use || to concatenate strings so just do that in your query.
    SELECT 'abc' || 'def' FROM DUAL;
    select '<?xml version="1.0" encoding="UTF-8"?>' || XMLELEMENT . . .

  • Setting the sql statement

    http://www.egbolig.dk/drift_bo_syd.rpt (HERE IS THE REPORT)
    We are using SAP Crystal Report .NET Runtime files (http://scn.sap.com/docs/DOC-7824 newest version 13.0.9.1312) in our web asp.net application. Everything have been working fine, but we have can into problems when showing the certain kinda reports.
    In our code get the reports sql statement using getSQLStatement.
    Dim gp As New GroupPath() Dim sql As String = report.ReportClientDocument.RowsetController.GetSQLStatement(gp)
    This will get the sql, and we use this sql (getSqlStatement) and attach a sql WHERE clause from the code to only get a certain number of records.
    The report Drift_bo_syd.rpt has 5 tables, and the following sql statement. 
    Database/Show Sql Statement
    SELECT "rekvstam"."Sel", "rekvstam"."Afd", "rekvstam"."Levadresse", "rekvstam"."Rekvisition", "rekvstam"."Lejemaal", "rekvstam"."Lejer", "rekvstam"."Udfoertaf", "rekvstam"."Udfoertdato", "rekvstam"."Krit", "Selskab"."Adresse", "Selskab"."Postby", "Selskab"."Tlf", "Selskab"."Fax", "rekvstam"."Kontor", "rekvstam"."Hjemme", "rekvstam"."Rekvdato", "rekvstam"."Aftale", "rekvstam"."InitialRet", "rekvstam"."Arbejde", "kreditor"."Att", "rekvstam"."Konto", "Selskab"."Navn", "Selskab"."Email", "Interessentadresse"."Navn", "Interessentadresse"."Adresse", "Interessentadresse"."Postby", "Interessentadresse"."Email1", "Interessentadresse"."Telefon_Fax", "Interessentadresse"."Type", "Interessentadresse"."Tlf1", "rekvstam"."tlfLejer", "kreditor"."Kred", "Interessentadresse"."Interessentnr" FROM  (("Rekvstam" "rekvstam" INNER JOIN "Selskab" "Selskab" ON "rekvstam"."Sel"="Selskab"."Sel") LEFT OUTER JOIN "Kreditor" "kreditor" ON "rekvstam"."Kred"="kreditor"."Kred") INNER JOIN "Interessentadresse" "Interessentadresse" ON "kreditor"."Interessentnr"="Interessentadresse"."Interessentnr" WHERE  "Interessentadresse"."Type"='K' 
    But if we run the report from our asp.net code, we get the following error: 
    Cannot determine the queries necessary to get data for this report. Failed to retrieve data from the database. Error in File Drift_Bo_Syd {97FED382-1BAC-4DB1-970F-9E098ECE28F1}.rpt: Failed to retrieve data from the database.
    After a long time searching for a solution, we found out that if we place the column kred from the kreditor table on the report, the report will work. (field explorer / database fields / kreditor (table) / kred (column)
    Very important is that the field "kreditor.kred" is a primary key of the table kreditor, and also used in the linking.!
    (We can get the report to work if we call the sql statement with the "kreditor"."kred" in the SELECT statement.
    SELECT "kreditor"."kred", "rekvstam"."Sel", "rekvstam"."Afd", "rekvstam"."Levadresse", "rekvstam"."Rekvisition", "rekvstam"."Lejemaal", "rekvstam"."Lejer", "rekvstam"."Udfoertaf", "rekvstam"."Udfoertdato", "rekvstam"."Krit", "Selskab"."Adresse", "Selskab"."Postby", "Selskab"."Tlf", "Selskab"."Fax", "rekvstam"."Kontor", "rekvstam"."Hjemme", "rekvstam"."Rekvdato", "rekvstam"."Aftale", "rekvstam"."InitialRet", "rekvstam"."Arbejde", "kreditor"."Att", "rekvstam"."Konto", "Selskab"."Navn", "Selskab"."Email", "Interessentadresse"."Navn", "Interessentadresse"."Adresse", "Interessentadresse"."Postby", "Interessentadresse"."Email1", "Interessentadresse"."Telefon_Fax", "Interessentadresse"."Type", "Interessentadresse"."Tlf1", "rekvstam"."tlfLejer", "kreditor"."Kred", "Interessentadresse"."Interessentnr" FROM  (("Rekvstam" "rekvstam" INNER JOIN "Selskab" "Selskab" ON "rekvstam"."Sel"="Selskab"."Sel") LEFT OUTER JOIN "Kreditor" "kreditor" ON "rekvstam"."Kred"="kreditor"."Kred") INNER JOIN "Interessentadresse" "Interessentadresse" ON "kreditor"."Interessentnr"="Interessentadresse"."Interessentnr" WHERE  "Interessentadresse"."Type"='K'
    But it should not be necessary to include this field (which is the primary key and used in linking the report) in the sql statement,
    BECAUSE it is not used in the report. So maybe this is a bug?
    It has not been necessary in RDC Crystal Report or RAS Crystal Report in a classic asp envoriment.
    Here is the code we use to set the reports SQL Statement)
    Try
    Dim conn As New SqlConnection(connString)
    conn.Open()
    Dim sd As New SqlDataAdapter(New SqlCommand(nySQL, conn))
    Dim ds As New Data.DataSet()
    Dim navn As String = report.Database.Tables.Item(0).Name
    sd.Fill(ds, navn)
    report.SetDataSource(ds)
    conn.Close()
    Catch ex As Exception
    Throw
    End Try

    Hi Jan
    I understand your problem completely but we have asked  R&D to be able to edit the SQL and they explained due to how the report Engine works it's simply not possible anymore. It would take a complete rewrite in all of our DB drivers and query dll's to be able to allow it. They did that in CR 9 when they rewrote the DB drivers and removed the SQL part of the code into separate dll's and that is when the ability was removed, it's been that way ever since.
    One possibility is to get the SQL from the Report and then connect to your DB using a .NET and if the results from the SQL is less than 5K rows and not too many columns you could then set the Report data source to a Dataset.
    As long as all of the field names are the same CR will run the report using this work flow.
    For data larger than 5K rows, limit is due to memory resources, you could save the DS to an XML file and then set the reports data source to the XML file. We've seen 100meg XML's used so the amount of data should not be a problem, but of course there are limits to everything so test...
    This should not affect performance much.
    So the work flow would be:
    Load the report
    Get the SQL Statement
    Paste it into a Dataset Query
    Something like this should get you started:
    //string connString = "Provider=SQLOLEDB;Data Source=MySQLServer;Database=xtreme;User ID=sa;Password=pw";
    string connString = "Provider=SQLNCLI10;Server=MySQLServer;Database=xtreme;User ID=sa;Password=pw";
    Detail"".""Quantity"" FROM   ""xtreme"".""dbo"".""Orders Detail"" ""Orders Detail""";
    string sqlString = @"SELECT top 10*  FROM  ""xtreme"".""dbo"".""Financials"" ""Financials""";
    System.Data.OleDb.OleDbConnection oleConn = new System.Data.OleDb.OleDbConnection(connString);
    System.Data.OleDb.OleDbCommand cmd = oleConn.CreateCommand();
    cmd.CommandText = sqlString;
    System.Data.DataSet ds = new System.Data.DataSet();
    OleDbDataAdapter oleAdapter = new OleDbDataAdapter(sqlString, oleConn);
    //OleDbDataAdapter oleAdapter2 = new OleDbDataAdapter(sqlString2, oleConn);
    DataTable dt1 = new DataTable("Financials");
    //DataTable dt2 = new DataTable("Orders Detail");
    oleAdapter.Fill(dt1);
    //oleAdapter2.Fill(dt2);
    ds.Tables.Add(dt1);
    //ds.Tables.Add(dt2);
    ds.WriteXml("c:\\reports\\sc2.xml", XmlWriteMode.WriteSchema);
    // as long as the field names match exactly Cr has no problems setting report to a DS.
    try
        rpt.SetDataSource(ds.Tables[0]); // incremtent [0] for more than 1 table.
        rpt.SetDataSource(ds);
    catch (Exception ex)
        MessageBox.Show("ERROR: Schema Mismatch. Error reported by CR: " + ex.Message);
    //Now check for subreport and set to same DS
    foreach (CrystalDecisions.CrystalReports.Engine.Section section in rpt.ReportDefinition.Sections)
        foreach (CrystalDecisions.CrystalReports.Engine.ReportObject reportObject in section.ReportObjects)
            if (reportObject.Kind == ReportObjectKind.SubreportObject)
                CrystalDecisions.CrystalReports.Engine.SubreportObject subReport = (CrystalDecisions.CrystalReports.Engine.SubreportObject)reportObject;
                CrystalDecisions.CrystalReports.Engine.ReportDocument subDocument = subReport.OpenSubreport(subReport.SubreportName);
                subDocument.SetDataSource(ds);
    And for XML it would use this part, not above I am saving the data and structure in the XML file so it should match what is in the report:
    foreach (CrystalDecisions.CrystalReports.Engine.Table rptTable in rpt.Database.Tables)
        try
            rptTable.Location = btrDataFile.ToString(); // @"D:\Atest\" + rptTable.Location + ".xml";
        catch (Exception ex)
            MessageBox.Show("ERROR: " + ex.Message);
    Only issue you may run into is sometimes XML does not have a direct field type and your original data source but you'll get an error if that happens which could be trapped and handled.
    If you have a report that only uses 2 tables I do have code that will convert it to use a Command Object. That is the limit the engine is capable of, there is a lot of logic to be able to do this in CRD and the SDK so that is all we could get for now.
    I hope that helps
    Don

  • SQL Server 2008 XML Datatype variable size limit

    Can you please let me know the size limit for XML Data type variable in SQL Server 2008?
    I have read some where that the XML data type holds up to 2GB size. But, its not the case.
    We have defined a variable with XML data type and assigning the value by using SELECT statement FOR XML AUTO with in CTE and assigning the outout of CTE to this XML type variable. 
    When we limit the rows to 64 which has a length of 43370(used cast(@XMLvariable AS varchar(max)), the variable returns the XML. However, if i increase the rows from 64 to 65 which is length of 44048, then the variable returns with Blank value.
    Is there any LENGTH limit of the XML data type?
    Thanks in advance!!

    Hello,
    See MSDN xml (Transact-SQL), the size limit is 2 GB and it is working. If your XML data will be truncated, then because you are doing something wrong; but without knowing table design
    (DDL) and your query it's difficult to give you further assistance; so please provide more details.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • SQL Statement on JDBC Adapter

    Hi all,
    how can I see the SQL Statement which is made by the JDBC Adapter.
    I have createt the XML Structure, but I want to know how PI (7.11) transformed the XML to SQL.
    How can I trace the JDBC Adapter? Which configuration is neccessary? Where can I find the trace?
    Thanks very much for your help!
    Jürgen

    Hi,
    this is my Auditlog
    Audit-Protokoll für Message: caded0e4-b287-1def-92a9-907432c01001
    Zeitstempel Typ Beschreibung
    2010-04-16 13:38:02 Information The message was successfully received by the messaging system. Protocol: XI URL: http://serv3709:52800/MessagingSystem/receive/AFW/XI Credential (User): PIISUSER
    2010-04-16 13:38:02 Information Using connection JDBC_http://sap.com/xi/XI/System. Trying to put the message into the request queue.
    2010-04-16 13:38:02 Information Message successfully put into the queue.
    2010-04-16 13:38:02 Information The message was successfully retrieved from the request queue.
    2010-04-16 13:38:02 Information The message status was set to DLNG.
    2010-04-16 13:38:02 Information Delivering to channel: test_etl
    2010-04-16 13:38:02 Information JDBC Adapter Receiver processing started, required QoS BestEffort
    2010-04-16 13:38:02 Information JDBC Adapter Receiver Channel test_etl:  processing started; party   / service E_DWH.
    2010-04-16 13:38:02 Information IS_RUN.MAP_SYS_LADELAUF_START.MAIN
    2010-04-16 13:38:02 Information Database request processed successfully.
    2010-04-16 13:38:02 Information The message was successfully delivered to the application using connection JDBC_http://sap.com/xi/XI/System.
    2010-04-16 13:38:02 Information The message status was set to DLVD.

  • JDBC Receiver: exact SQL statement

    Hi,
    I'm in an IDoc-JDBC scenario, using XML-SQL messages to feed a JDBC Receiver and I am getting <i>weird messages</i> returned by Oracle.
    Question: is there a way to log/trace/audit <b>the exact SQL statement</b> that my channel is sending to Oracle??
    Thanks.
    Alex

    hi Alessandro,
    try: logSQLStatement
    from SAP note: 801367
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

Maybe you are looking for

  • How do I automatically fetch for all folders in Inbox?

    I'm running an iPHone 4 with iOS5.  When i retrieve my email, only the inbox retrieves, but not any of the folders in the account.  I want to retrieve all the emails to that account. I searched online, and found this response to a question re iOS3: i

  • How can I verify my phone number to use FaceTime and iMessage instead of email address!?

    My iMessage and FaceTime are both working, but it still says "Waiting for activation.." right under both the FaceTime and iMessage settings. Under the "Receive At" setting, my email address is entered in. When I press on my email address, it takes me

  • Help Moving iWeb site to a windows PC

    My objective is to create a site using iWeb and move that site to a standalone PC and use Firefox to read the site folder and run the site. Not needing any internet. The files are too large anyway. I have created the iWeb site with many videos from i

  • Quotes in attributes in a custom tag are failing in weblogic 5.1

    This seems to be on and off behaviour but when my tags are failing I           have traced it down to the fact that my attributes have quotes in           them. (By the way I'm running weblogic 5.1 with service pack 10)           ie:           <a:foo

  • Video playback stops at first bitrate switch

    When playing my manifest file for HTTP dynamic streaming, it will play the first bitrate (150), however, at exactly 6 seconds, it tries to switch to a higher bitrate (1500) and the video stops playing, but the audio continues. I have tried multiple m