(XML) HTTP POST to Stored Procedure (mod_plsql)

Hi,
first of all, sorry if this is the wrong forum, I've also tried SQL/PLSQL with no answer at all, so I atleast wanted to give it a go here,
as you guys probably have some mod_plsql experience.
Let's put up an example scenario:
Vendor X wants a URL to POST xml data. E.g:
Content-Type: text/xml
Content-Length: (length)
<?xml version="1.0" encoding="utf-8"?>
<document>
<info>testxml</info>
<answers>
<a1>yes</a1>
<a2>no</a2>
<a3>yes</a3>
<a4>yes</a4>
</answers>
</document>I want to store this information in the database. I really don't care if it gets stored as CLOB or XMLType, but I'm really just looking for a way to do this with a simple PLSQL procedure.
Is this possible? How would that procedure look?
All I know for now, is that the url would be http://apache-server/pls/dad/schema.[pkg.]proc - and that the process needs grant execute to [daduser].
Was not able to find information on this in mod_plsql documentation.
Running the prebuilt Oracle HTTP-server (Apache 2-version) and Oracle DB 11.1.0.7.
Best regards,
Vidar

Metalink Note:357384.1 -How to Redirect a Request With a Parameter Value
Metalink Note 258285.1- Sending Parameters as a GET or POST When Using Mod_plsql.
HTH
Anantha.

Similar Messages

  • Pre & Post Load Stored Procedures

    Hi,
    I am new to PLSQL and I would like to write Pre Load & Post Load Stored Procedures for dropping & rebuilding the indexes created on a table.
    Can any body give me an example for this.
    I need the PLSQL query ASAP since the requirement is urgent.
    Thanks in Advance,
    Regards,
    Raghu

    Why don't you go for Rebuild option for indexexBecause the OP wants to take their indexes offline whilst they do a bulk load.
    Anyway.
    When building a database good practice advises us to have two sets of scripts - a build script and a regression script - and to keep these scripts in a source control repository. This not only allows us to build and rebuild our database at will, as well as providing an audit trail for the database design, it also allows us to solve problems like this fairly easily.
    Presumably you don't have these scripts. If you're on 9i or better you can use the DBMS_METADATA package to generate them. If you've got a lot of indexes you can drive off the USER_INDEXES view as shown. Make sure you do this before gnerating and running a script to drop those indexes! If you are on an earlier version of Oracle you will have to build the CREATE scripts by interrogating the USER_INDEXES and USER_IND_COLUMNS (and possibly USER_IND_EXPRESSIONS) views; this is a messier option.
    Be sure that dropping and recreating the indexes really does take less time than having them whilst you do the build. Also, remember to get new statistics for the re-created indexes (if you're using CBO).
    Cheers, APC

  • How to get XML output from a stored procedure

    I have a very simple question:
    I would like to write a stored procedure (SP) that will return results in XML format (as a string). My tables in database are not of XML TYPE. But I need XML output.
    ie, SP will run like a typical SP but the only difference will be its output in XML.
    1) is it possible?
    2) if possible, how?
    Please, help
    Omer Koksal

    Thank you Peter, it was a great problem for me !
    Omer Koksal

  • Sending '?' in XML tag to Oracle Stored Procedure

    I have a situation that I cannot find the answer to why it is happening.
    I am sending an XML data type to an oracle stored procedure. In one of the fields, I need to allow the '?' character to be sent.
    <ADDITIONALINFO>This is where I want ? to be</ADDITIONALINFO>
    When I send the info to the stored procedure I get the following error: ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing
    LPX-00216: invalid character 191 (0xBF)Error at line 19
    What I do not understand is that the character (0xBF) is the inverted question mark �
    I have been able to get around the issue by changing the question mark to &#63; which is the decimal format for the question mark and the query works.
    ie: <ADDITIONALINFO>This is where I want &#63 to be</ADDITIONALINFO>
    Is there another delimiter that is needed for '?' like what is needed to print the & in & fashion?
    Any insight to this issue would be helpful.

    There are some characters that you cannot use in an XML document, but I was not aware that the questionmark was one of them. As far as I know, you need to transform the characters '&', '<' and '>', and any character with a code higher than 127. The fact that the question mark is turned into an upside down questionmark seems to be some weird functionality.

  • Ampersands in XML HTTP POST

    Hi All,
    I am working on a project where XML files are received through HTTP POSTs.
    When I am receiving the XML String as a parameter it (the string) is being broken up into sections.
    sXML = getParameter("XMLString");
    However, the XML contains ampersands (& &apost;..etc) and the getParameter is only capturing up until the first ampersand. It appears to be behaving as if there is another parameter there.
    Any help would be great!
    Thanks,
    Teddy.

    as an addition, in case you didn't realise the & character is used to seperate parameters in a HTTP GET string, hence the behavoiur you are getting.

  • Best method to transfer large strings (XML data) to/from stored procedure

    Hi!
    I'm trying to call a PL/SQL procedure from Java. The procedure inputs a string (XML) that is parsed, and returns a result string (also XML).
    Typical size of the string is 5kb -> 1mb.
    I can see two possible solutions:
    1) String / LONG
    2) CLOB (Using DMBS_LOB.createTemporary and getting a CLOB locator and passing the locator to the stored procedure)
    Does anyone have other suggestions?
    What is the fastest method for transferring XML structures from to and from stored procedures?
    Anders

    Anders,
    I would say it depends on your requirement. Both the methods have some advantages and disadvantages.
    Using a CLOB means that you have to use vendor specific libraries but this is more extendible and I fast too.
    Using String/Long will be more portable in the long run but again you lose on speed/performance.
    Just a doubt of mine... If I got it correct, you are transforming one XML to another XML based on some conditions. Why dont you use XSL and XSL StyleSheet Processor packaged with XDK for this? I think this would be the fastest way.
    Hope this helps.

  • XML/SQL Utility and stored procedure

    Hi there,
    Is it possible to use the XML/SQL Utility passing a stored
    procedure call, which returns a result set (ref cursor), instead
    of a SELECT statement? If yes, how should I call the
    OracleXMLQuery constructor?
    Thanks,
    Flavio.
    null

    Here's a sample. The next code drop of the XSQL Servlet will make the easy-to-do from within XSQL Pages:
    package package1;
    import org.w3c.dom.*;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import oracle.xml.sql.query.OracleXMLQuery;
    public class Class1 extends Object {
    public static void main( String[] arg ) throws Exception {
    Connection conn = getConnection();
    CallableStatement ocs = conn.prepareCall("begin ? := App.HotItems('PAUL'); end;");
    ocs.registerOutParameter(1,OracleTypes.CURSOR);
    ocs.execute();
    ResultSet rs = ((OracleCallableStatement)ocs).getCursor(1);
    OracleXMLQuery oxq = new OracleXMLQuery(conn,rs);
    System.out.println(oxq.getXMLString());
    oxq.close();
    rs.close();
    ocs.close();
    conn.close();
    public static Connection getConnection() throws Exception {
    String username = "scott";
    String password = "tiger";
    String dburl = "jdbc:oracle:thin:@localhost:1521:xml";
    String driverClass = "oracle.jdbc.driver.OracleDriver";
    Driver d = (Driver)Class.forName(driverClass).newInstance();
    return DriverManager.getConnection(dburl,username,password);
    null

  • Parsing of xml file in oracle stored procedure on linux server

    We have an XML file in the "/database/stats/dev/xml1/" path and tried to parse the file using the below code :
    p := xmlparser.newParser;
    xmlparser.setValidationMode(p, FALSE);
    -- xmlparser.setErrorLog(p, errfile);
    xmlparser.setBaseDir(p, dir);
    xmlparser.parse(p, inpfile);
    doc := xmlparser.getDocument(p);
    xmlparser.freeParser(p);
    The above procedure is throwing below mentioned exception at "xmlparser.parse(p, inpfile);".
    SQLCODE: ORA-31001
    SQLERRM: ORA-31001: Invalid resource handle or path name "/xml1.dtd"
    The xml file contains the following line, which is giving an error, while parsing the xml file.
    <!DOCTYPE CCIOrder SYSTEM "xml1.dtd">
    Directory Structure:
    OWNER DIRECTORY_NAME DIRECTORY_PATH
    SYS XML1 /database/stats/dev/xml1

    you'll need to use server-side code to check the xml file names in that folder, return that list to flash and display the list to the user.
    or, if you can get by presenting a hard-coded list of xml files, you won't need any server-side coding.

  • Getting values from a stored procedure with no parameters

    Hi,
    I'm trying to get values out of a stored procedure that I created on SQL server. I'm trying to get XML values out of the database, but I'm not sure how to get any data out of it written to a file if the procedure doesn't have any parameters.
    So I'm just making a call:
    CallableStatement cs = conn.prepareCall("{call myproc}");
    cs.execute();How do I get values back from this stage?
    Thank you very much,
    Lior

    The short form answer, which assumes that the stored procedure is returning the XML as an out parameter would go something like this.
         public void build(String newUserID, String newPassword) throws SQLException {
              String sql = "{ call GET_ITEM_DETAIL(?, ?, ?, ?, ?, ?) }" ;
              try{
                   init(newUserID, newPassword) ;
                   setCallableStatement(getConnection().prepareCall(sql)) ;
                   getCallableStatement().setInt(1, getItemNumber()) ;
                   getCallableStatement().registerOutParameter(2, oracle.jdbc.driver.OracleTypes.CURSOR) ;
                   getCallableStatement().registerOutParameter(3, oracle.jdbc.driver.OracleTypes.INTEGER) ;
                   getCallableStatement().registerOutParameter(4, oracle.jdbc.driver.OracleTypes.VARCHAR);
                   getCallableStatement().registerOutParameter(5, oracle.jdbc.driver.OracleTypes.VARCHAR) ;
                   getCallableStatement().registerOutParameter(6, oracle.jdbc.driver.OracleTypes.VARCHAR) ;
                   getCallableStatement().execute() ;
                   setSqlResult(getCallableStatement().getInt(3)) ;
                   setSqlMessage(getCallableStatement().getString(4)) ;
                   if( getSqlResult() != 0 ){
                        throw new SQLException(getSqlMessage(), null, getSqlResult()) ;
                   setResultSet((java.sql.ResultSet) getCallableStatement().getObject(2)) ;
                   if( getResultSet() != null ){
                        while( getResultSet().next() ){
                             setItemType(getResultSet().getString("ITEM_TYPE")) ;
                             setItemValue(getResultSet().getString("ITEM_VAL")) ;
                             setDisplayType(getCallableStatement().getString(5)) ;
                             setDisplaySize(Integer.parseInt(getCallableStatement().getString(6))) ;
              catch(SQLException e){
                   java.util.Date now = new java.util.Date() ;
                   java.text.DateFormat format = java.text.DateFormat.getInstance() ;
                   setSqlMessage( e.getClass().getName() + " : " + format.format(now) + " : " + e.getMessage() + " : IN " + getClass().getName() ) ;
                   System.err.println(getSqlMessage()) ;
                   throw e ;
              finally{
                   closeResources() ;
         }The GET_ITEM_DETAIL stored procedure returns several out parameters of various types. The code registers them as out parameters along with an anticipated type and then calls the getXXX(n) method that corresponds with that data type in the appropriate position.
    As I mentioned in my other post, the onus of returning the XML is on the stored procedure, when you get it into Java it's going to be a java.lang.String that you can then parse by whatever means is appropriate to your situation.
    Regards,

  • Stored Procedure in SQL Server 2005

    Hi Friends,
    when i execute the stored procedure , i can get below error.
    Error processing request in sax parser: Error when executing statement for table/stored proc. 'XI_SP_KANLOGDATA_KLOGDATA' (structure 'Statement'): java.sql.SQLException: ERROR: Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'table' (Setting a SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !)
    My XML Message below format:
    <Statment>
    --<dbStmt action="EXECUTE">
      ---<table>storedprocedurename</table>
      ---<EMPNO isInput="true" type="char">0001</EMPNO>
      ---<EMPNAME isInput= "true type="char">Sateesh</EMPNAME>
      ---<ADDRESS isInput="true" type="char">Delhi</ADDRESS>
    --<dbStmt action="EXECUTE">
      ---<table>storedprocedurename</table>
      ---<EMPNO isInput="true" type="char">0002</EMPNO>
      ---<EMPNAME isInput= "true type="char">Sateesh1</EMPNAME>
      ---<ADDRESS isInput="true" type="char">Bangalore</ADDRESS>
    --<dbStmt action="EXECUTE">
      ---<table>storedprocedurename</table>
      ---<EMPNO isInput="true" type="char">0003</EMPNO>
      ---<EMPNAME isInput= "true type="char">Sateesh3</EMPNAME>
      ---<ADDRESS isInput="true" type="char">Hyderabad</ADDRESS>
    </Statement>

    Hi abishek,
    My scenario is basically JDBC(SQL Server)XIJDBC(ORACLE)(Synchronous)
    XI pick the date field from JDBC Sender and goes to ORACLE Database and selects records based upon the condition, and response back and put this data into JDBC(SQL Server),
    My process successfully upto receive the response from ORACLE system and after response mapping also successful.after that  response message is insert into SQL Server.
    In SQL server we have two tables,one DATA table and LOG table, If insert the data into DATA table successfully LOG table updated with DATE and STATUS field not successfully insert LOG table update with DATE and Error status field.
    So I impleted "stored procedure" in SQL side.
    Any way i solved that error.
    I am using below XML structure with out table field,i followed below blog.
    http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9618. [original link is broken] [original link is broken] [original link is broken]
    My stored procedure name is: XI_SP_KDATA_KLOGDATA
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_DB_SELECT_REQUEST_response xmlns:ns0="urn:pg-siemens-com:POCA0013:sample1">
    - <Statement_response>
    - <XI_SP_KDATA_KLOGDATA action="EXECUTE">
      <EMPNO type="CHAR">901064</EMPNO>
      <EMPNAME type="CHAR">Sateesh</EMPNAME>
      <ADDRESS type="CHAR">Hyderabad</ADDRESS>
      </XI_SP_KDATA_KLOGDATA>
    - <XI_SP_KDATA_KLOGDATA action="EXECUTE">
      <EMPNO type="CHAR">901000</EMPNO>
      <EMPNAME type="CHAR">Ashish</EMPNAME>
      <ADDRESS type="CHAR">Bangalore</ADDRESS>
      </XI_SP_KDATA_KLOGDATA>
      </Statement_response>
      </ns0:MT_DB_SELECT_REQUEST_response>
    But again i faced one error in Communication channel
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'XI_SP_KDATA_KLOGDATA' (structure 'Statement_response'): com.microsoft.sqlserver.jdbc.SQLServerException: Procedure or function XI_SP_KANLOGDATA_KLOGDATA has too many arguments specified.
    My doubt is above error is Stored procedure error or XML Structure error?
    Don't hesitate to clarify me.
    Thank you.
    sateesh
    Edited by: sateesh kumar .N on Mar 4, 2010 11:58 AM
    Edited by: sateesh kumar .N on Mar 4, 2010 11:59 AM
    Edited by: sateesh kumar .N on Mar 4, 2010 12:00 PM

  • JDBC Receiver, Stored Procedure that Deletes

    Hi,
    I have a stored procedure that deletes fields in a table based on a lot of different criteria.
    I can't use DELETE or SQL_QUERY ie Statement3 and 6 in http://help.sap.com/saphelp_nw04s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm . I can only use this Stored Procedure.
    This is my message type.
    <MT_HEADER>
        <Statement>
             <ClearTable>
                 <action>.......attribute...set to EXECUTE
                  <table> .......maps to Stored Procedure
                  <isInput>  ......attribute... set to TRUE
                  <type>   ........attribute...set to STRING
    However, I'm getting this error
    ERROR: Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'table' (Setting a SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !)
    Any ideas?

    Damien,
    If you look in the link you have procided, the datatype for Stored Procedure every element needs to have a TYPE attribute asscoiated with it and you need to give the corresponding Datatype of that element,
    <i>The attribute type=<SQL-Datatype> , which describes the valid SQL data type, is mandatory for all parameter types (IN, OUT, INOUT).
    The following SQL data types are supported:
    INTEGER, BIT, TINYINT, SMALLINT, BIGINT, FLOAT, REAL, DOUBLE, NUMERIC, DECIMAL, CHAR, VARCHAR, STRING, LONGVARCHAR, DATE, TIME, TIMESTAMP, BINARY, VARBINARY, LONGVARBINARY, BLOB (input and output),CLOB (input and output), CURSOR (output; only in conjunction with the Oracle JDBC driver).
    </i>
    Regards
    Bhavesh

  • ESB calling stored procedures

    Hi,
    I am trying to invoke a stored procedure from a ESB Routing Service. I have done mapping from the input schema to Stored procedure schema.
    Input xml looks like this,
    <CRequest xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.doe.gov/strs">
                        <Transaction>
                             <transactionID>0</transactionID>
                             <sourceSystemID>STRIPES</sourceSystemID>
                             <transactionDate>2007-07-24T15:24:52-04:00</transactionDate>
                             <SystemAccess>
                                  <userID/>
                                  <password/>
                             </SystemAccess>
                        </Transaction>
                        <Requisition>
                             <ORIGIN>PRISM</ORIGIN>
                             <REQUISITIONNUM>FRANK-REQ-001</REQUISITIONNUM>
                             <RequisitionLine>
                                  <ITEMNUM>1</ITEMNUM>
                                  <SEQNUM>2</SEQNUM>
                                  <Shipment>
                                       <SHIPTOADDR_CODE>5896383</SHIPTOADDR_CODE>
                                       <SHIPTOADDR_NAME>PEGGYE WILKERSON-504-589-6383</SHIPTOADDR_NAME>
                                       <Account>
                                            <ACCOUNTCODE>ACCT 1-ACCT 2-2007</ACCOUNTCODE>
                                            <GENERIC1>00500</GENERIC1>
                                            <GENERIC2>2007</GENERIC2>
                                       </Account>
                                  </Shipment>
                             </RequisitionLine>
                        </Requisition>
                   </CommitmentRequest>
    My Stored procedure schema looks like this
    <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/C_STRIPES_APIS_PKG/CREATE_C_MAIN/" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/C_STRIPES_APIS_PKG/CREATE_COMMITMENT_MAIN/" elementFormDefault="qualified">
    <element name="InputParameters">
    <complexType>
    <sequence>
    <element name="PVN_TRANSACTION_ID" type="decimal" db:index="1" db:type="NUMBER" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <element name="OutputParameters">
    <complexType>
    <sequence>
    <element name="PVN_RETCODE" type="decimal" db:index="2" db:type="NUMBER" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    </schema>
    I am writing the payload that goes into the Stored procedure to an output file and it contains the proper value for transactionId (which has been mapped to SP input argument..)
    But it doesnt seem to invoke the procedure at all. I am confirming that it is not invoking the stored procedure(SP) as I have written out the input value that comes into the SP and this value is null.
    Is there something that I need to do this to work?
    I also found out that what I supply is integer , but the SP is looking for decimal. I saw these types in the mapping file.(.xsl).
    <CRequest><Transaction><transactionId> type is integer.
    <InputParameters><PVN_TRANSACTION_ID> type is decimal.
    Does that make any difference?
    Thanks,

    Thanks James.
    I always wonder where to look for errors. I look in <ORACLE_HOME>J2EE/logs.log.xml. Is it the right place? I also look under opmn folder. I dont see any good error message anywhere. ESB is very bad in communicating back to users. Sometimes it writes just the payload and no error message like why it didnt like the payload.
    Regarding executing Stored procedure, I have some logging statements in Stored procedure that writes the incoming input to a temporary table and this value is always null. So, the Stored Procedure in not getting the value passed by the ESB DB adapter node. I have the mapping done using xsl that writes from input xml to input of stored procedure.
    Any ideas?

  • Size limitation that can be passed to Java stored procedure

    Hello!
    I enjoy using Oracle8i these days. But I have some questions
    about Java stored procedure. I want to pass the XML data to Java
    stored procedure as IN parameter. But I got some errors when the
    data size is long. Is there any limitation in the data size that
    can be passed to Java stored procedure?
    Would you please help me ?
    This message is long, but would you please read my message?
    Contents
    1. Outline : I write what I want to do and the error message I
    got
    2. About the data size boundary: I write about the boundary
    size. I found that it depend on which calling sequence I use.
    3. The source code of the Java stored procedure
    4. The source code of the Java code that call the Java stored
    procedure
    5. The call spec
    6. Environment
    1.Outline
    I want to pass the XML data to Java stored procedure. But I got
    some errors when the data size is long. The error message I got
    is below.
    [ Error messages and stack trace ]
    java.sql.SQLException: ORA-01460: unimplemented or unreasonable
    conversion reque
    sted
    java.sql.SQLException: ORA-01460: unimplemented or unreasonable
    conversion reque
    sted
    at oracle.jdbc.ttc7.TTIoer.processError(Compiled Code)
    at oracle.jdbc.ttc7.Oall7.receive(Compiled Code)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(Compiled Code)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch
    (TTC7Protocol.java:721
    at oracle.jdbc.driver.OracleStatement.doExecuteOther
    (Compiled Code)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch
    (Compiled Code)
    at oracle.jdbc.driver.OracleStatement.doExecute(Compiled
    Code)
    at
    oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(Compiled
    Code
    at
    oracle.jdbc.driver.OraclePreparedStatement.executeUpdate
    (OraclePrepar
    edStatement.java:256)
    at oracle.jdbc.driver.OraclePreparedStatement.execute
    (OraclePreparedStat
    ement.java:273)
    at javaSp.javaSpTestMain.sample_test
    (javaSpTestMain.java:37)
    at javaSp.javaSpTestMain.main(javaSpTestMain.java:72)
    2. About the data size boundary
    I don|ft know the boundary that I got errors exactly, but I
    found that the boundary will be changed if I use |gprepareCall("
    CALL insertData(?)");|h or |gprepareCall ("begin insertData
    (?); end ;")|h.
    When I use |gprepareCall(" CALL insertData(?)".
    The data size 3931 byte ---&#61664; No Error
    The data size 4045 byte ---&#61664; Error
    Whne I use prepareCall ("begin insertData(?); end ;")
    The data size 32612 byte --&#61664;No Error
    The data size 32692 byte ---&#61664; Error
    3. The source code of the Java stored procedure
    public class javaSpBytesSample {
    public javaSpBytesSample() {
    public static int insertData( byte[] xmlDataBytes ) throws
    SQLException{
    int oraCode =0;
    String xmlData = new String(xmlDataBytes);
    try{
    Connection l_connection; //Database Connection Object
    //parse XML Data
    dits_parser dp = new dits_parser(xmlData);
    //Get data num
    int datanum = dp.getElementNum("name");
    //insesrt the data
    PreparedStatement l_stmt;
    for( int i = 0; i < datanum; i++ ){
    l_stmt = l_connection.prepareStatement("INSERT INTO test
    " +
    "(LPID, NAME, SEX) " +
    "values(?, ?, ?)");
    l_stmt.setString(1,"LIPD_null");
    l_stmt.setString(2,dp.getElemntValueByTagName("name",i));
    l_stmt.setString(3,dp.getElemntValueByTagName("sex",i));
    l_stmt.execute();
    l_stmt.close(); //Close the Statement
    l_stmt = l_connection.prepareStatement("COMMIT"); //
    Commit the changes
    l_stmt.execute();
    l_stmt.close(); //Close the Statement l_stmt.execute
    (); // Execute the Statement
    catch(SQLException e ){
    System.out.println(e.toString());
    return(e.getErrorCode());
    return(oraCode);
    4. The source code of the Java code that call the Java stored
    procedure
    public static void sample_test(int num) {
    //make data
    Patient p = new Patient();
    byte[] xmlData = p.generateXMLData(num);
    try{
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new
    oracle.jdbc.driver.OracleDriver());
    Connection m_connection = DriverManager.getConnection
    ("jdbc:oracle:thin:@max:1521:test",
    "testuser", "testuser");
    CallableStatement l_stmt =
    // m_connection.prepareCall(" CALL insertData(?)");
    m_connection.prepareCall("begin insertData(?); end
    l_stmt.setBytes(1,xmlData);
    l_stmt.execute();
    l_stmt.close();
    System.out.println("SUCCESS to insert data");
    catch(SQLException e ){
    System.out.println( e.toString());
    e.printStackTrace();
    5. The call spec
    CREATE OR REPLACE PROCEDURE insertData( xmlData IN LONG RAW)
    AS
    LANGUAGE JAVA NAME 'javaSp.javaSpBytesSample.insertData(byte[])';
    6. Environment
    OS: Windows NT 4.0 SP3
    RDBMS: Oracle 8i Enterprise Edition Release 8.1.5.0.0 for
    Windows NT
    JDBC Driver: Oracle JDBC Drivers 8.1.5.0.0.
    JVM: Java1.1.6_Borland ( The test program that call Java stored
    procedure run on this Java VM)
    null

    Iam passing an array of objects from Java to the C
    file. The total size of data that Iam sending is
    around 1GB. I have to load this data into the Shared
    memory after getting it in my C file. Iam working on
    HP-UX (64-bit). Everything works fine for around 400MB
    of data. When I try to send around 500MB of data, the
    disk utilization becomes 100%, so does my memory
    utilization and I get a "Not enough space" when I try
    to access shared memory. I have allocated nearly 2.5GB
    in my SHMMAX variable. Also, I have around 45GB of
    disk free. The JVM heap size is also at 2048MB. Where did you get the 400/500 number from? Is that the size of the file?
    What do you do with the data? Are you doing nothing but copying it byte for byte into shared memory?
    If yes then a simple test is to write a C application that does the same thing. If it has problems then it means you have an environment problem.
    If no then you are probably increasing the size of the data by creating a structure to hold it. How much overhead does that add to the size of the data?

  • JDBC Receiver adapter Stored procedure

    We are using stored procedure to insert/update the data into SQL database, for this I define data type  as below
    But the JDBC call is failing with error " com.sap.engine.interfaces.messaging.api.exception.MessagingException:
    Error processing request in sax parser: Error when executing statement for
    table/stored proc. 'insert_IDOCRec' (structure 'STATEMENT'):
    java.sql.SQLException: ERROR: Invalid XML document format for stored procedure:
    'type="<SQL-type>"' attribute is missing for element 'table' (Setting a
    SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !)"
    Can you please help me why the JDBC call is failing with the above error.

    I think your struct is wrong,the right is following:
    DT_INSPLOT_JDBC_REC_REQ
              STATEMENT
                        insert_IDOCRec     Element     1..unbounded
                        action                    Attribute     xsd:string     required
                        table                     Element          xsd:string     1
                        field1                      Element    1
                             isInput               Attribute     xsd:boolean     required
                             type                 Attribute     xsd:boolean     required
                        field2                      Element    1
                             isInput               Attribute     xsd:boolean     required
                             type                 Attribute     xsd:boolean     required
    from the log you send to us, the struct miss the table element.

  • Structure for Stored Procedure Call

    Hi All,
             Guys I am trying to call a stored procedure call using receiver jdbc adapter...
    This is the outgoing message:
    <b><?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:SP_DB xmlns:ns0="urn:sce-com:xi:dev:mohammf">
    - <Test>
    - <PP_TEST_P action="EXECUTE">
      <table>PP_TEST_P</table>
      <RECTYPEIND type="CHAR">CC</RECTYPEIND>
      <JENUMBER type="CHAR">76724</JENUMBER>
      <COMPANY type="CHAR">BCEO</COMPANY>
      <CONSTANT1 type="CHAR">AB</CONSTANT1>
      <SYSTEMDATE type="CHAR">08/12/2007</SYSTEMDATE>
      <DR_CR_ID type="CHAR">0</DR_CR_ID>
      <AMOUNT type="CHAR">934928599475843</AMOUNT>
      <MONTH_NUMBER type="CHAR">000008</MONTH_NUMBER>
      <COST_CENTER type="CHAR">LosAngeles</COST_CENTER>
      <ORDERNO type="CHAR">694950375830</ORDERNO>
      <WBS type="CHAR">Southern California Edis</WBS>
      <ACCOUNTID type="CHAR">6949503758</ACCOUNTID>
      <BATCH_ID type="CHAR">3408102007</BATCH_ID>
      <ASSIGNMENT type="CHAR">Technology Solutio</ASSIGNMENT>
      <GL_JOURNAL_CATEGORY type="CHAR">GHTF</GL_JOURNAL_CATEGORY>
      <PROFIT_CENTER type="CHAR">3434694950</PROFIT_CENTER>
      <REFDOCNUMBER type="CHAR">00000000004304300056006056</REFDOCNUMBER>
      </PP_TEST_P>
    - <PP_TEST_P action="EXECUTE">
      <table>PP_TEST_P</table>
      <RECTYPEIND type="CHAR">XX</RECTYPEIND>
      <JENUMBER type="CHAR">76724</JENUMBER>
      <COMPANY type="CHAR">BCEO</COMPANY>
      <CONSTANT1 type="CHAR">AB</CONSTANT1>
      <SYSTEMDATE type="CHAR">08/12/2007</SYSTEMDATE>
      <DR_CR_ID type="CHAR">0</DR_CR_ID>
      <AMOUNT type="CHAR">934928599475843</AMOUNT>
      <MONTH_NUMBER type="CHAR">000008</MONTH_NUMBER>
      <COST_CENTER type="CHAR">LosAngeles</COST_CENTER>
      <ORDERNO type="CHAR">694950375830</ORDERNO>
      <WBS type="CHAR">Southern California Edis</WBS>
      <ACCOUNTID type="CHAR">6949503758</ACCOUNTID>
      <BATCH_ID type="CHAR">3408102007</BATCH_ID>
      <ASSIGNMENT type="CHAR">Technology Solutio</ASSIGNMENT>
      <GL_JOURNAL_CATEGORY type="CHAR">GHTF</GL_JOURNAL_CATEGORY>
      <PROFIT_CENTER type="CHAR">3434694950</PROFIT_CENTER>
      <REFDOCNUMBER type="CHAR">00000000004304300056006056</REFDOCNUMBER>
      </PP_TEST_P>
      </Test>
      </ns0:SP_DB></b>
    The error I am getting is: 
    <b><i>2007-08-20 09:44:05 Error Unable to execute statement for table or stored procedure. 'PP_TEST_P' (Structure 'Test') due to java.sql.SQLException: ERROR: Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'table' (Setting a SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !)
    2007-08-20 09:44:05 Error JDBC message processing failed; reason Error processing request in sax parser: Error when executing statement for table/stored proc. 'PP_TEST_P' (structure 'Test'): java.sql.SQLException: ERROR: Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'table' (Setting a SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !)
    2007-08-20 09:44:05 Error MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'PP_TEST_P' (structure 'Test'): java.sql.SQLException: ERROR: Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'table' (Setting a SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !)
    2007-08-20 09:44:05 Error Exception caught by adapter framework: null
    2007-08-20 09:44:05 Error Delivery of the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'PP_TEST_P' (structure 'Test'): java.sql.SQLException: ERROR: Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'table' (Setting a SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !).</i></b>
    Pls advice..
    XIer
    Message was edited by:
            XIer

    Hi,
    Check your DATA TYPE attributes with the attributes of the column names in the Database table.  There is a mismatch between the DT and Table in the database.
    <b>Cheers,
    *RAJ*</b>

Maybe you are looking for

  • Can not add items to the dock

    I can not add icons to the dock, I am able SOMETIMES to edit the dock (moving icons around or delete them), there is no rule, sometimes I can grab the icon on the dock, and sometimes I just can't (I have the pop up when I can't) , I deleted users/use

  • New iphone 5 setup with icloud backup from 4s iOS5.1 (HELP PLEASE)

    long story hopefully an easy fix.... on wensday my power supply went and had to ship computer across country to Puget Computer Systems as we weren't sure if it was power supply or mobo...luckily it was power supply. i daily backed up iphone 4s with i

  • Error "...You need a later version of Reader"

    Hi I have downloaded the latest version XI but I still can not open pdf documents? What do I do? Regards

  • XI Page Header conditional suppression not exporting to editable RTF

    I have a report that I don't want the page header to print on the first page (using the report header instead). It works great exporting to everything except editable RTF. If i have a suppression condition on the page header, it doesn't print on any

  • BAPI_GOODSMVT_CREATE gm01 move type 101 reutrn none

    Hi,      it's a very strang issue.i need goods receipt for a po.the code should be very simple,but it return none, no error and no success message. is anyone in the case,give me some tips,thank you very much. my code like: DATA: WA_EBAN   LIKE EBAN,