Generate schema-base XML from XML fragments

I have a defined .xsd file and an incoming xml file that I am inspecting in a BEFORE INSERT trigger. I registered the xml schema to create a single column table of xmltype. The incoming xml consists of a root node and two data nodes. There are 3 elements on the first data node that need to have their value updated before the xml doc is inserted into the xmltype Oracle table.
I was trying to find a way to use updateXML(), but that seems to work only for an existing row in the table. I then turned my attention to createXML(). I grabbed the root node and two data nodes and built 3 different clob's. One of the clob's contains an updated data node. Then I am doing the following:
:new.sys_nc_rowinfo$ := createXML(clob1||clob2||clob3, registeredURL);
registeredURL contains the URL that was registed in the schema. While it seems that the signature of the createXML() function is correct (I get no compile errors), the results are not valid per the schema. Is there a way in PL/SQL to do what I am trying to do? Seems like a pretty simple concept.

Nikhil,
There is a wealth of information available on the Internet regarding the XML capabilities of the Oracle database.
Have you done an Internet search for "SQL XML Oracle"?
Good Luck,
Avi.

Similar Messages

  • Issues while generating Schema DAT files

    We are facing two type of issues when generating Schema ".dat" files from Informix Database on Solaris OS using the
    "IDS9_DSML_SCRIPT.sh " file.
    We are executing the command on SOLARIS pormpt as follows..
    "IDS9_DSML_SCRIPT.sh <DBName> <DB Server Name> ".
    The first issue is ,after the command is excuted ,while generating the ".dat" files the following error is occuring .This error is occuring for many tables
    19834: Error in unload due to invalid data : row number 1.
    Error in line 1
    Near character position 54
    Database closed.
    This happens randomly for some schemas .So we again shift the script to a different folder in Unix and execute it.
    Can we get the solution for avoiding this error.
    2. The second issue is as follows..
    When the ".dat" files are generated without any errors using the script ,these .dat files are provided to the OMWB tool to load the Source Model.
    The issue here is sometimes OMWB is not able to complete the process of creating the Source Model from the .dat files and gets stuck.
    Sometimes the tables are loaded ,but with wrong names.
    For example the Dat files is having the table name as s/ysmenus for the sysmenus table name.
    and when loaded to oracle the table is created with the name s_ysmenus.
    Based on the analysis and understanding this error is occuring due to the "Delimiter".
    For example this is the snippet from a .dat file generated from the IDS9_DSML_SCRIPT.sh script.The table name sysprocauthy is generated as s\ysprocauthy.
    In Oracle this table is created with the name s_ysprocauthy.
    s\ysprocauthy║yinformixy║y4194387y║y19y║y69y║y4y║y2y║y0y║y2005-03-31y║y65537y║yT
    y║yRy║yy║y16y║y16y║y0y║yy║yy║y╤y
    Thanks & Regards
    Ramanathan KrishnaMurthy

    Hello Rajesh,
    Thanks for your prompt reply. Please find my findings below:
    *) Have there been any changes in the extractor logic causing it to fail before the write out to file, since the last time you executed it successfully? - I am executing only the standard extractors out of the extractor kit so assumbly this shouldnt be a issue.
    *) Can this be an issue with changed authorizations? - I will check this today, bt again this does not seem to be possible as the same object for a different test project i created executed fine and a file was created.
    *) Has the export folder been locked or write protected at the OS level? Have the network settings (if its a virtual directory) changed? - Does not seem so because of the above reason.
    I will do some analysis today and revert back for your help.
    Regards
    Gundeep

  • Generate database schema in XML from database structure

    hi
    I want to generate the entire database schema in XML from database structure. (Same feature is provided by Altova XMLSpy).
    It would be great if there was some API that does the process of parsing the database structure and generating the XML automatically. A similiar feature is provided by Apache DdlUtils' API, but a stable version is not yet available...
    Please help!
    Thanks in advance.

    Nikhil,
    There is a wealth of information available on the Internet regarding the XML capabilities of the Oracle database.
    Have you done an Internet search for "SQL XML Oracle"?
    Good Luck,
    Avi.

  • [svn:bz-trunk] 21260: Update the qa-frameworks. zip to remove all comments from the base xml when merging config files.

    Revision: 21260
    Revision: 21260
    Author:   [email protected]
    Date:     2011-05-16 07:46:54 -0700 (Mon, 16 May 2011)
    Log Message:
    Update the qa-frameworks.zip to remove all comments from the base xml when merging config files.
    Modified Paths:
        blazeds/trunk/qa/resources/frameworks/qa-frameworks.zip

    Try options=('!makeflags') in PKGBUILD.

  • Generating XML fragment

    Hopefully a quick one that I'm just missing.
    I have a child table:
    create table files (docid number(9), filename varchar2(200), filetype varchar2(30));
    insert into files values (1, '1.pdf', 'primary');
    insert into files values (2, '2.pdf', 'primary');
    insert into files values (2, '3.pdf', 'secondary');
    insert into files values (2, '4.pdf', 'tertiary');
    insert into files values (2, '5.pdf', 'pending');
    insert into files values (3, '6.pdf', 'secondary');
    insert into files values (3, '7.pdf', 'secondary');What I need is an XML fragment to add to the parent document XML to indicate whether a document has a child filetype of some (but not all) of the permitted types.
    The rules are:
    if a 'primary' exists, create an element <orig>Y</orig>, otherwise create an element <orig>N</orig>
    if a 'secondary' exists, create an element <alt>Y</alt>, otherwise create an element <alt>N</alt>
    if a 'tertiary' exists, create an element <fin>Y</fin>, otherwise create an element <fin>N</fin>
    if a 'pending' exists, do nothing
    the result would be something similar to the following for a given docid:
    docid 1 : <orig>Y</orig><alt>N</alt><fin>N</fin>
    docid 2 : <orig>Y</orig><alt>Y</alt><fin>Y</fin>
    docid 3 : <orig>N</orig><alt>Y</alt><fin>N</fin>I've got a brute force solution in hand, but I'm pretty sure there's a more elegant way.

    Hi,
    Here's one way, if you want to create one fragment at a time for a given DOCID :
    SQL> SELECT xmlagg(
      2           case ftype
      3             when 'primary' then xmlelement("orig", ftype_exists)
      4             when 'secondary' then xmlelement("alt", ftype_exists)
      5             when 'tertiary' then xmlelement("fin", ftype_exists)
      6           end
      7         ) as result
      8  FROM (
      9    SELECT t.column_value as ftype
    10         , case when count(f.filetype) != 0 then 'Y' else 'N' end as ftype_exists
    11    FROM files f
    12         RIGHT OUTER JOIN
    13           TABLE(
    14             sys.odcivarchar2list( 'primary'
    15                                 , 'secondary'
    16                                 , 'tertiary' )
    17           ) t
    18             ON t.column_value = f.filetype
    19             AND f.docid = 1
    20    GROUP BY t.column_value
    21  );
    RESULT
    <orig>Y</orig><alt>N</alt><fin>N</fin>
    For multiple DOCID in the same query, a slight modification using a partitioned outer join :
    SQL> SELECT docid
      2       , xmlagg(
      3           case ftype
      4             when 'primary' then xmlelement("orig", ftype_exists)
      5             when 'secondary' then xmlelement("alt", ftype_exists)
      6             when 'tertiary' then xmlelement("fin", ftype_exists)
      7           end
      8         ) as result
      9  FROM (
    10    SELECT f.docid
    11         , t.column_value as ftype
    12         , case when count(f.filetype) != 0 then 'Y' else 'N' end as ftype_exists
    13    FROM files f
    14         PARTITION BY (f.docid)
    15         RIGHT OUTER JOIN
    16           TABLE(
    17             sys.odcivarchar2list( 'primary'
    18                                 , 'secondary'
    19                                 , 'tertiary' )
    20           ) t
    21             ON t.column_value = f.filetype
    22    GROUP BY f.docid, t.column_value
    23  )
    24  GROUP BY docid
    25  ;
         DOCID RESULT
             1 <orig>Y</orig><fin>N</fin><alt>N</alt>
             2 <orig>Y</orig><fin>Y</fin><alt>Y</alt>
             3 <orig>N</orig><fin>N</fin><alt>Y</alt>

  • How to Generate and Register XML Schema

    Does any one know how to gererate Oracle type XML schema provided XML file and register to XMLType field?
    Thanks for any expert suggestion...

    The SQL statement below shows how one can register XML schema to an XMLType column:
    create table po_tab(
    id number,
    po sys.XMLType
    xmltype column po
    XMLSCHEMA "http://www.oracle.com/PO.xsd"
    element "PurchaseOrder";
    Similarly you can register XML schema to the INVDOC field in the your INVOICE table.
    Hope it helps
    Shefali
    (OTN team)

  • A better way to generate the needed XML?

    I am working on a 10.2 system and looking to see if there is a better way to generate the resulting XML than what I have come up with. Here is a test case and the output it generates. I don't really like querying the table for each column needed as the real table has eight columns I am pulling. I would like to make one pass on person_h and get the info needed instead of making eight passes, but not sure if it is possible.
    with person_h as
       (select 1 id, 'M' gender, 'W' race, '170' weight from dual union all
        select 1, 'M', 'W', '170' from dual union all
        select 1, 'M', 'W', '180' from dual union all
        select 1, 'M', NULL, '175' from dual union all
        select 1, NULL, 'W', NULL from dual
    select xmlelement("Person",
             (select xmlagg(xmlelement("Sex", gender))
                from (select distinct gender
                        from person_h
                       where id = 1
                         and gender is not null) pg),
             (select xmlagg(xmlforest(race as "Race"))
                from (select distinct race
                        from person_h
                       where id = 1) pg),
             (select xmlagg(xmlforest(weight as "Weight"))
                from (select distinct weight
                        from person_h
                       where id = 1) pg)
           ).getstringval()
      from dual;
    Output
    <Person>
      <Sex>M</Sex>
      <Race>W</Race>
      <Weight>170</Weight>
      <Weight>175</Weight>
      <Weight>180</Weight>
    </Person>Note: Previously posted on the XML DB forum at A better way to generate the needed XML? but still looking for other solutions so putting in front of more eyes here. I have considered using a WITH statement to do the initial query on person_h but haven't tested that yet to see what Oracle really will do as just getting back around to this lower priority task of mine.

    I'm using the WITH statement to simulate a table and DUAL/UNION ALL to create data in that "table". I've seen it used plenty of times in this forum so not sure why a problem for this example. The actual SQL/XML statement hits that "base table" three times, so I didn't include all eight columns because three columns is sufficient to show the problem in the way I coded the SQL. Following the SQL is the sample OUTPUT that SQL statement generates and that is the output I created and need. I'm just looking for other options to achieve the listed output.

  • XML Publisher question - Not generating a valid XML file

    I am working through an Oracle document that walks you through creating an XML Pub report. I am using HCM 8.9, Tools 8.49.15 and it has XML Pub installed and I have the Microsoft plug-in installed
    I have created a query and have downloaded an rtf template and now am on a page where you enter your data source and then click ‘Generate’ for the sample data file. I did it and it created ‘PERSONAL_DATA_PAY.XML’ which is created from a PS Query. However if I click on ‘PERSONAL_DATA_PAY.XML’ it generates a blocky text file that is not an XML file and I can’t go any further.
    Do you know why it’s not generating a valid XML file when I click on 'generate'?
    Thanks
    Allen H. Cunningham
    Data Base Administrator - Oracle/PeopleSoft
    Sonoma State University

    You mean to say that you create a new data source by specifying Data Source Type as 'PS Query' and Data Source ID as your query name, you are not able to generate a valid XML file (by clicking on Generate link).
    did you cross check your query by running it?
    On field change of Generate link, PeopleSoft uses PSXP_RPTDEFNMANAGER and PSXP_XMLGEN app packagaes and query objects to create the file
    It should work if you query is valid..

  • How To Store XML Fragments Using Functions Such As XMLElement

    Hi
    Not sure what I am missing. I wish to store XML fragments in variables so can pass around and concatenate with other fragments to make final XML document. Even before attempting to concatenate XML fragments, I am struggling to store any XML fragment in a variable. I am trying to use simple functions such as XMLElement to generate XML so can store in variable. I have seen many examples of XMLElement in SQL select statement. Can XMLElement be used in plsql? XMLElement says it returns value of type XMLType. Functions such as XMLElement make generating XML easier than creating all tags manually.
    Below is simple example that demonstrates what I would like to do. I would like to be able to pass the XML fragment as either XMLType or clob. I receive error saying PLS-00201: identifier 'XMLELEMENT' must be declared
    declare
    vTheData XMLType;
    vTheDataClob clob;
    begin
      vTheData:= XMLelement("empno",'1234567');
      vTheDataClob:= xmlelement("empno",'1234567').getclobval();
    end;
    Where as I can use below, but surely don't have to use select into from dual method. I just expect can use XMLElement function in plsql same as sql, such as most other functions eg length, rtrim etc.
    declare
    vTheData XMLType;
    vTheDataClob clob;
    begin
      select xmlelement("empno",'1234567')
      into vTheData
      from dual;
      select xmlelement("empno",'1234567').getclobval()
      into vTheDataClob
      from dual;
    end;
    Hope this makes sense.
    Thanks

    Having said that, is there a more elegant way to achieve below. That is populate two XML fragments and concatenate together.
    Sure, why not just only one statement?
    select XMLConcat(
             XMLElement( ... )
           , XMLElement( ... )
    into vTheResult
    from dual;
    As a second question, is it better to build and pass XML fragments as XMLType or clob?
    I would say stay with XMLType but it depends on your requirement.
    I generally avoid passing around pieces of data, SQL/XML functions are powerful in the way they can be used with set operations, so using them in a piecewise approach kinda negates what they're for.

  • Accessing schema-based XML table

    HI Gentlemen,
    I have a schema-based XMLtype table that I have to query in detail (e.g. via XPath). Documentation states that XML mapping is possible through some Java programming. However, I do not have XML content in a .xml file, it has already been loaded into Oracle DB (that is - non-JAXB)!
    Can anybody recommend a sample code or description of the technology?
    Thanks, regards from
    Miklos HERBOLY

    Your xml document may by represented as an column, you will got the content as other attributes.
    You will not be able to manage the structure of your document natively via the adf layer ... you may marshall/unmarshall the content into a class you build with jaxb or with castor by example (much better interface and classes).
    Note that you will be able to generate a data control from the class that represent the document and use the elements (and/or attributes) of your sturcture in your web pages by drag and drop like for columns in a table.
    Hope this help a little bit

  • Adding xml fragment to SOAP body (SAAJ)

    Hi all,
    we are using SOAP (or better SAAJ) in a modular design as packaging/enveloping format for arbitrary payloads which are generated by different modules.
    How is it possible to add a xml fragment (as InputStream or DOM Node) to a SOAP Body ?
    Nick
    [email protected]

    Hi Vicky,
    I guess, we have a little misunderstanding here. The core SOAP specification defines the structure of the envelope, the "SOAP with attachments" specification extends that by defining how to add binary attachments. This is accomplished by using MIME. Every attachment is another MIMEPart, but the SOAP Envelope always has to be present as first MIMEPart. Now I don't want to add any attachments, I only want to construct a SOAP Envelope that contains arbitrary xml docs (fragments) in the body.
    Look at the example below, the tags with namespace "S" belong to the SOAP specification and are built by our SOAP layer, the tags with namespace "m" belong to some other namespace and are generated by a totally different component.
    My question was how I could add (within SAAJ) the xml fragment starting with "m:PurchaseOrder" to the envelope without having to add element by element.
    <S:Envelope>
         <S:Header>
              ...optional header tags
         </S:Header>
         <S:Body>
                    <!---from here it is a different namespace, SOAP doesn't know about PurchaseOrders>
              <m:PurchaseOrder>
                   <m:position>
                        <m:article>0815</m:article>
                        <m:description>mainboard</m:description>
                        <m:price>50</m:price>
                   </m:position>
                   <m:position>
                        <m:article>0816</m:article>
                        <m:description>cpu</m:description>
                        <m:price>100</m:price>
                   </m:position>
              </PurchaseOrder>
                    <!---from here, it is SOAP again>
         </S:Body>
    </S:Envelope>

  • Migrating V9 to V10: Update XML Fragment CLOB does not work anymore

    I have an XML Schema that contains an element, named Operazione, mapped to a CLOB.
    I just migrate to Oracle 10.1.0.2.0 from version 9.2.0.2.0 and the code I developed does not work anymore.
    To get a CLOB on v 9.2.0.2.0 I issued the following statement:
    select extractValue(value(p),'/operazione.log/Operazione') from XMT_OPERAZIONE_LOG p
    where existsNode(value(p),'/operazione.log/Journal[NumeroElettronico=1234567890]') = 1
    To make it working on V10 I have to change it as follow:
    select extract(value(p),'/operazione.log/Operazione').getClobVal() from XMT_OPERAZIONE_LOG p
    where existsNode(value(p),'/operazione.log/Journal[NumeroElettronico=1234567890]') = 1
    So using extract intead of extractValue and adding getClobVal() I was able to read the CLOB.
    The problem that I was not able to solve is related to CLOB update. In V9 just adding the “for update” clause I was able to change the CLOB value on DB.
    In V10 if I run the V9 statement I get the error:
    ORA-03113: end-of-file on communication channel
    If I use the statement modified for V10, adding the “for update” clause, I get the CLOB and I can change the CLOB value but nothing goes on the DB. Probably I am working on a copy of the DB CLOB.
    If I remove the getClobVal() I get an OPAQUE type that I can use on a XMLType but, still, nothing is stored on DB.
    Any suggestion ?
    I tried with both OCI and Thin Client

    Can anybody help me ?
    Is it better to use different strategies ( eg. Stored Procedure, DBMS_XMLSTORE etc, etc. ) ?
    Any experience updatating XML Fragment CLOB on Oracle V10 ?

  • Schema based xml db

    how to create schema based xml database..i have tried but showing errors
    how to register the xml schema......

    LOL - "being the ACE" - hereby some of the things you could do
    an example
    clear screen
    -- Drop user TEST if it exists - Cleaning Up First
    conn / as sysdba
    set echo on
    set termout on
    set feed on
    drop user test cascade;
    purge dba_recyclebin;
    create user test identified by test;
    grant xdbadmin, dba to test;
    connect test/test
    set echo on
    set termout on
    set feed on
    var schemaPath varchar2(256)
    var schemaURL  varchar2(256)
    pause
    clear screen
    begin
      :schemaURL := 'http://www.myserver.com/root.xsd';
      :schemaPath := '/public/root.xsd';
    end;
    -- Create an XML Schema root.xsd in directory /public/
    declare
      res boolean;
      xmlSchema xmlType := xmlType(
    '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:xdb="http://xmlns.oracle.com/xdb"
                xmlns="http://www.myserver.com/root.xsd" targetNamespace="http://www.myserver.com/root.xsd"
                elementFormDefault="qualified"
                attributeFormDefault="unqualified"
                xdb:storeVarrayAsTable="true">
    <xs:element name="ROOT" xdb:defaultTable="ROOT_TABLE" xdb:maintainDOM="false">
      <xs:annotation>
       <xs:documentation>Example XML Schema</xs:documentation>
      </xs:annotation>
      <xs:complexType xdb:maintainDOM="false">
       <xs:sequence>
        <xs:element name="ID" type="xs:integer" xdb:SQLName="ID"/>
        <xs:element ref="INFO" xdb:SQLInline="false" />
       </xs:sequence>
      </xs:complexType>
    </xs:element>
    <xs:element name="INFO" xdb:SQLName="INFO_TYPE">
      <xs:complexType xdb:maintainDOM="false">
       <xs:sequence>
        <xs:element name="INFO_ID" type="xs:integer" xdb:SQLName="TYPE_INFO_ID"/>
        <xs:element name="INFO_CONTENT"
                    xdb:SQLName="TYPE_INFO_CONTENT" type="xs:string"/>
       </xs:sequence>
      </xs:complexType>
    </xs:element>
    </xs:schema>');
    begin
    if (dbms_xdb.existsResource(:schemaPath)) then
        dbms_xdb.deleteResource(:schemaPath);
    end if;
    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    end;
    pause
    clear screen
    -- Selecting repository files and folders via XDBUriType
    select xdbURIType ('/public/root.xsd').getClob()
    from   dual;
    pause
    clear screen
    begin
      :schemaURL := 'http://www.myserver.com/root.xml';
      :schemaPath := '/public/root.xml';
    end;
    -- Create an XML Document root.xml in directory /public/
    declare
      res boolean;
      xmlSchema xmlType := xmlType(
    '<?xml version="1.0" encoding="UTF-8"?>
    <ROOT xmlns="http://www.myserver.com/root.xsd">
    <ID>0</ID>
    <INFO>
       <INFO_ID>0</INFO_ID>
       <INFO_CONTENT>Text</INFO_CONTENT>
    </INFO>
    </ROOT>');
    begin
    if (dbms_xdb.existsResource(:schemaPath)) then
        dbms_xdb.deleteResource(:schemaPath);
    end if;
    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    end;
    pause
    clear screen
    -- Selecting repository files and folders via XDBUriType
    select xdbURIType ('/public/root.xml').getClob()
    from   dual;
    pause
    clear screen
    -- Delete an XML schema in the registry if it exists
    call DBMS_XMLSCHEMA.deleteSchema('http://www.myserver.com/root.xsd', 4);
    commit;
    select * from tab;
    alter session set events='31098 trace name context forever';
    BEGIN
    DBMS_XMLSCHEMA.registerSchema
    (SCHEMAURL => 'http://www.myserver.com/root.xsd',
      SCHEMADOC => xdbURIType('/public/root.xsd').getClob(),
      LOCAL     => FALSE, -- local
      GENTYPES  => TRUE,  -- generate object types
      GENBEAN   => FALSE, -- no java beans
      GENTABLES => TRUE,  -- generate object tables
      OWNER     => USER
    END;
    commit;
    select * from tab;
    pause
    clear screen
    -- Insert some data with XDBURIType
    DECLARE
       XMLData xmlType := xmlType(xdbURIType ('/public/root.xml').getClob());
    BEGIN
      for i in 1..10
      loop
          insert into ROOT_TABLE
          VALUES
          (XMLData);
      end loop;
    END;
    commit;
    -- randomize the data a little
    update ROOT_TABLE
    set object_value = updateXML(object_value,
                                '/ROOT/ID/text()',
                                substr(round(dbms_random.value*100),0,2)
    update ROOT_TABLE
    set object_value = updateXML(object_value,
                                '/ROOT/INFO/INFO_ID/text()',
                                substr(round(dbms_random.value*100),0,2)
    commit;
    pause
    clear screen
    -- End Result
    select count(*) from root_table;
    select * from root_table where rownum < 5;

  • JCo Calling BAPI and generate htm and xml page in output

    Friends,
            I am developing an Application in Java using JCO. The requirement there is a list of BAPI's are available for the selection, once the user select the BAPI , it will dynamically generates the screen of input parameters and than result will be stored in .htm and .xml file. It works for many BAPI's, but for few of that it won't work. Will you help me out why its gng to create problem for other BAPI's.
    e.g.
    BAPI_SALESORDER_GETLIST
    BAPI_PO_GETITEMS
    BAPI_MATERIAL_GET_DETAIL and few more...
    It doesn't generate the proper output of these BAPI's.
    Thanks.
    HItesh Shah

    Tanveer,
    There are many files so i wont be able to put the codes but let me tell u how i m doing.
    1) Giving the options to user in which server they want to connect.
    2) After connection has been established there is a plain text file available which consists the list of BAPI's which will be displayed in the list box.
    3) After user select any BAPI and press a button named 'DETAILS' it will display the Import/Export/Tables list.
    4) After clicking on Next , i m generating a dynamic screen for input parameters.
    5)Here is this step also one problem is that i have to write all the zeros, can u tell me if i want to pad the zeroes automatically what i will do.Becz every time the input parameters of each BAPI would be different.
    6) After getting input parameters i will generate the .htm and .xml file using writeXML and writeHTML function.
    7) I want to show them generated xml and html file in iexplore using clicking button...Can u tell me how to achieve that.
    Here is the code through which my xml and htm file will be generated.
    import com.sap.mw.jco.*;
    import java.io.*;
    import java.util.*;
    import java.math.*;
    import java.util.Iterator;
    // Quick imports
    import com.jxml.quick.QDoc;
    import com.jxml.quick.Quick;
      class RFCG {
          static final String SID = "R3";
          String conDetails []=new String[6];
          String ErrorMsg;
          int i=0;
          String LogonDetail;
          int Rows;
          IRepository repository;
          String InputName[]=new String[200];
          String InputType[]=new String[200];
          String OutputName[]=new String[200];
          String OutputType[]=new String[200];
          String OutputINTTYPE[]=new String[200];
          String OutputField[]=new String[200];
          String TableName[]=new String[500];
          String TableType[]=new String[500];
          String TableINTTYPE[]=new String[500];
          String FIELDNAME[]=new String[500];
          //String FIELDNAME[]=new String[20];
          String FIELDINTTYPE[]=new String[500];
          String OutputFieldType[]=new String[200];
          String OutputFieldINTTYPE[]=new String[200];
          String InputParFieldName[][]=new String[200][200];
          String InputParFieldDatatype[]=new String[200];
          String InputParFieldIntType[]=new String[200];
          int l,j,k,m,n,o,t,q;
           /** public static void main(String [] args){
                  new RFCG("SAPR3.txt");
             public RFCG(String LogonDetail,String BAPI)
                      this.LogonDetail=LogonDetail;
                      cleanUp();
                      try {
                                 /* for xml */
                                 // Initialize Quick
                                  QDoc schema = PersonSchema.createSchema();
                              // Convert input XML to Java
                                  QDoc doc = Quick.parse(schema, "input.xml");
                             // Get the result
                                  Person person = (Person)Quick.getRoot(doc);
                               for (Iterator i = person.getClientList().iterator(); i.hasNext(); ) {
                                            Client number = (Client)i.next();
                                           // String type=number.getType();
                                            //System.out.println(type);
                                           // System.out.println(LogonDetail+"LOGO");
                                            if(LogonDetail.equals(number.getType())){
                                                   //conDetails[0]=number.getType();
                                                   conDetails[0]=number.getSapclient();
                                                   conDetails[1]=number.getUserid();
                                                   conDetails[2]=number.getPassword();
                                                   conDetails[3]=number.getLanguage();
                                                   conDetails[4]=number.getHostname();
                                                   conDetails[5]=number.getSystemnumber();
                                            //System.out.println("  Client Type(" + number.getType() + "):");
                                          //System.out.println("  Sapclient " + number.getSapclient());
                                          //System.out.println("  Userid  " + number.getUserid());
                                          //System.out.println("  Password " + number.getPassword());
                                          //System.out.println("  Language " + number.getLanguage());
                                          //System.out.println("  Hostname  " + number.getHostname());
                                          //System.out.println("  Systemnumber  " + number.getSystemnumber());
                                          //System.out.println("   \n  ");
                               } catch (Exception e) {
                                     e.printStackTrace();
                      Connect(LogonDetail);
                      zbapi(BAPI);
                      new BapiParameters1(InputName,InputType,OutputName,OutputType,TableName,TableType,BAPI,repository,OutputINTTYPE,FIELDNAME,FIELDINTTYPE,OutputField,OutputFieldType,OutputFieldINTTYPE,LogonDetail,InputParFieldName,InputParFieldDatatype,InputParFieldIntType);
                      for (int i = 0; i < 10; i++) {
                               //System.out.println("STRING***RFCG*******"InputName<i>'\t'+InputType<i>);
         public void Connect(String LogonDetail){
         //CustName=CustName;
      /** try{
           File myFile = new File(LogonDetail);
           FileReader fr= new FileReader(myFile);
           BufferedReader reader=new BufferedReader(fr);
           String line=null;
           while ((line=reader.readLine())!=null){
                     String[] result=line.split(":");
                     conDetails<i>=result[1];
                     System.out.println(conDetails<i>);
                     ++i;
                reader.close();
           }catch(Exception ex){
                ex.printStackTrace();
               try {
                 JCO.addClientPool( SID,           // Alias for this pool
                                    10,            // Max. number of connections
                                    conDetails[0], // SAP client
                                    conDetails[1], // userid
                                            conDetails[2], // password
                                    conDetails[3], // language
                                    conDetails[4], // host name
                                    conDetails[5] );
                 this.repository = JCO.createRepository("MYRepository", SID);
                 //System.out.println("Connected"+ repository);
               catch (JCO.Exception ex) {
                 //System.out.println("Caught an exception: \n" + ex);
                 ErrorMsg=ex.toString();
                 //new Error(ex);
                 if (ErrorMsg!=null){
                      new Error(ErrorMsg);
             protected void cleanUp() {
                           JCO.removeClientPool(SID);
    public void zbapi(String BAPI)
        JCO.Client client = null;
        JCO.Table codes = null;
        try {
          // Get a function template from the repository
          //FunctionTemplate ftemplate = repository.getFunctionTemplate(person.getRFCName());
             IFunctionTemplate ftemplate = repository.getFunctionTemplate("FUNCTION_GET");
          // if the function definition was found in backend system
          if(ftemplate != null) {
          // Create a function from the template
            JCO.Function function = ftemplate.getFunction();
            // Get a client from the pool
            client = JCO.getClient(SID);
            // Fill in input parameters
            JCO.ParameterList input = function.getImportParameterList();
            input.setValue(BAPI, "FUNCNAME");
            client.execute(function);
            // Print return message
            //JCO.Structure ret = function.getExportParameterList().getString("NAME1");
              codes = function.getTableParameterList().getTable("PRMTAB");
                 //System.out.println("ROWS:"+codes.getNumRows());
                 this.Rows=codes.getNumRows();
                 //System.out.println(this.Rows);
              //System.out.println("PTYPE" + '\t' + "PNAME" + '\t' + "FIELDNAME" + '\t' + "DATATYPE");
         for (int i = 0; i < codes.getNumRows(); i++, codes.nextRow()) {
                                  //System.out.println(codes.getString("PARAMTYPE")+ '\t' +
                                  //codes.getString("NAME") + '\t'codes.getString("FIELDNAME")
                                  //'t' +codes.getString("DATATYPE"));
                                  if (codes.getString("PARAMTYPE").equals("1")){
                                        InputName[j]=codes.getString("NAME");
                                        InputType[j]=codes.getString("INTTYPE");
                                        //InputINTTYPE[j]=codes.getString("INTTYPE");
                                        ++j;
                                  else if(codes.getString("PARAMTYPE").equals("2")){
                                             OutputName[k]=codes.getString("NAME");
                                             OutputType[k]=codes.getString("DATATYPE");
                                             OutputINTTYPE[k]=codes.getString("INTTYPE");
                                             ++k;
                                  else if(codes.getString("PARAMTYPE").equals("3")){
                                             TableName[l]=codes.getString("NAME");
                                             TableType[l]=codes.getString("DATATYPE");
                                             TableINTTYPE[l]=codes.getString("INTTYPE");
                                             ++l;
                                       /**else if(codes.getString("PARAMTYPE").equals("5")){
                                            //System.out.println("RFCGGGGG"+InputParFieldName[o]);
                                             InputParFieldName[q][o]=codes.getString("FIELDNAME");
                                             if(t==0){
                                                  t=1;
                                                  //System.out.println("RFCGGGGG"InputParFieldName[o]"           "+t);
                                                        InputParFieldDatatype[o]=codes.getString("NAME");
                                              else{
                                                   int w=o-1;
                                                   System.out.println("OoOoOooo"w"\t"+o);
                                                   if(InputParFieldDatatype[w].equals(InputParFieldDatatype[o])){
                                                  //System.out.println("RFCGGGGG"InputParFieldName[o]"           "+t);
                                                  System.out.println("yes");
                                                 else{
                                                   InputParFieldDatatype[o]=codes.getString("NAME");
                                                   ++q;
                                             InputParFieldIntType[o]=codes.getString("INTTYPE");
                                                                                ++o;
                                  else if(codes.getString("PARAMTYPE").equals("6")){
                                            if(!codes.getString("NAME").equals("RETURN")){
                                                  //if(codes.getString("NAME").equals(TableName[]))
                                                  OutputField[n]=codes.getString("FIELDNAME");
                                                  //OutputFieldType[n]=codes.getString("DATATYPE");
                                                  OutputFieldINTTYPE[n]=codes.getString("INTTYPE");
                                                  ++n;}
                                  else if(codes.getString("PARAMTYPE").equals("7")){
                                             FIELDNAME[m]=codes.getString("FIELDNAME");
                                             FIELDNAME[m]=codes.getString("DATATYPE");
                                             //System.out.println("TABLEFIELD"+FIELDNAME[m]);
                                             FIELDINTTYPE[m]=codes.getString("INTTYPE");
                                             ++m;
          else {
                //System.out.println("Function not found"  );
                   //new Error("Function not Found");
            //System.out.println("Function BAPI_SALESORDER_GETLIST not found in backend system.");
          }//if
        catch (Exception ex) {
         System.out.println("Caught an exception: \n" + ex);
         ErrorMsg=ex.toString();
              //System.out.println("2222Caught an exception: \n" + ErrorMsg);
                   if (ErrorMsg!=null)
                               new Error(ErrorMsg);
         //        new Error(ex);
        finally {
          // Release the client to the pool
                    //System.out.println("2222Caught an exception: \n" + ErrorMsg);
          JCO.releaseClient(client);
    /**protected void cleanUp() {
                  JCO.removeClientPool(SID);
    Thanks,
    Hitesh

  • Need to generate a Index xml file for corresponding Report PDF file.

    Need to generate a Index xml file for corresponding Report PDF file.
    Currently in fusion we are generating a pdf file using given Rtf template and dataModal source through Ess BIPJobType.xml .
    This is generating pdf successfully.
    As per requirement from Oracle GSI team, they need index xml file of corresponding generated pdf file for their own business scenario.
    Please see the following attached sample file .
    PDf file : https://kix.oraclecorp.com/KIX/uploads1/Jan-2013/354962/docs/BPA_Print_Trx-_output.pdf
    Index file : https://kix.oraclecorp.com/KIX/uploads1/Jan-2013/354962/docs/o39861053.out.idx.txt
    In R12 ,
         We are doing this through java API call to FOProcessor and build the pdf. Here is sample snapshot :
         xmlStream = PrintInvoiceThread.generateXML(pCpContext, logFile, outFile, dbCon, list, aLog, debugFlag);
         OADocumentProcessor docProc = new OADocumentProcessor(xmlStream, tmpDir);
         docProc.process();
         PrintInvoiceThread :
              out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
                   out.print("<xapi:requestset ");
                   out.println("<xapi:filesystem output=\"" + outFile.getFileName() + "\"/>");
                   out.println("<xapi:indexfile output=\"" + outFile.getFileName() + ".idx\">");
                   out.println(" <totalpages>${VAR_TOTAL_PAGES}</totalpages>");
                   out.println(" <totaldocuments>${VAR_TOTAL_DOCS}</totaldocuments>");
                   out.println("</xapi:indexfile>");
                   out.println("<xapi:document output-type=\"pdf\">");
    out.println("<xapi:customcontents>");
    XMLDocument idxDoc = new XMLDocument();
    idxDoc.setEncoding("UTF-8");
    ((XMLElement)(generator.buildIndexItems(idxDoc, am, row)).getDocumentElement()).print(out);
    idxDoc = null;
    out.println("</xapi:customcontents>");
         In r12 we have a privilege to use page number variable through oracle.apps.xdo.batch.ControlFile
              public static final String VAR_BEGIN_PAGE = "${VAR_BEGIN_PAGE}";
              public static final String VAR_END_PAGE = "${VAR_END_PAGE}";
              public static final String VAR_TOTAL_DOCS = "${VAR_TOTAL_DOCS}";
              public static final String VAR_TOTAL_PAGES = "${VAR_TOTAL_PAGES}";
    Is there any similar java library which do the same thing in fusion .
    Note: I checked in the BIP doc http://docs.oracle.com/cd/E21764_01/bi.1111/e18863/javaapis.htm#CIHHDDEH
              Section 7.11.3.2 Invoking Processors with InputStream .
    But this is not helping much to me. Is there any other document/view-let which covers these thing .
    Appreciate any help/suggestions.
    -anjani prasad
    I have attached these java file in kixs : https://kix.oraclecorp.com/KIX/display.php?labelId=3755&articleId=354962
    PrintInvoiceThread
    InvoiceXmlBuilder
    Control.java

    You can find the steps here.
    http://weblogic-wonders.com/weblogic/2009/11/29/plan-xml-usage-for-message-driven-bean/
    http://weblogic-wonders.com/weblogic/2009/12/16/invalidation-interval-secs/

Maybe you are looking for

  • Access Time Machine Backup from a different computer

    Hi everyone, I have recently had to put my Macbook in for repair and have been told it will be about a month before I get it back. My wife has a Macbook of her own, so I using that for the time being to continue working on my MA essays due in the nex

  • How to see the result

    hi every body... i want to get the result of any table.. for ex: select * from dept; the o/p should be like(10~Accounts~new york) for this i wrote this code.... it run sucessfully; my prob is how to see the Result.. declare tn varchar2(35); sqlstmt v

  • Syncing problems won't go away

    I have an annoying problem with my new computer. Whenever I want to add songs that I purchased from itunes to my ipod and connect it to my laptop, it requests I choose to erase and sync or to add my ipod songs to my library, either way it's a disaste

  • [SOLVED PAR/LY]kde 4.2 -- akonadi configuration + kmail crash problems

    Hey guys, Recently i decided to give kde 4.2 a try , (been using gnome for months) and after the update i have these two distinct (i think) problems with kmail. When i run kmail  ,  it tries to start akonadi server, which fails due to configuration i

  • Enum in JSF 1.2_06 - EnumConverter Bug

    Hi, I have a Enum as such : public enum ComponentType {      AJAX_SUPPORT { public String toString(){ return "Ajax Support";} },      INPUT_TEXT { public String toString(){ return "Input Text";}},      OUTPUT_TEXT { public String toString(){ return "