How to dpwnload one XML file for each report row

Hi all,
i have a report on the products table with about 1000 rows
desc of table products
product_id varchar (10)
product_desc varchar2 (2000)
I would like to download on the file system an xml file for each row of the report
the nane of each xml file = <product_id>.xml
thanks in advance
km

Hi,
You would probably find it better to search on the PL/SQL forum as this is more their area than Apex.
From what I can see in there (and there are a number of examples that would help you), you need to do something like:
DECLARE
vPATH VARCHAR2(50) := '/DEV';
vFILENAME VARCHAR2(50);
vFILE UTL_FILE.FILE_TYPE;
BEGIN
FOR C IN (SELECT PRODUCT_ID, PRODUCT_DESC FROM PRODUCTS)
LOOP
  vFILENAME := C.PRODUCT_ID || '.xml';
  vFILE := UTL_FILE.FOPEN(vPATH, vFILENAME, 'W');
  UTL_FILE.PUT_LINE(vFILE, '<xdr>');
  UTL_FILE.PUT_LINE(vFILE, '<product_id>' || C.PRODUCT_ID || '</product_id>');
  UTL_FILE.PUT_LINE(vFILE, '<product_desc>' || C.PRODUCT_DESC || '</product_desc>');
  UTL_FILE.PUT_LINE(vFILE, '</xdr>');
  UTL_FILE.FCLOSE(vFILE);
END LOOP;
END;I haven't included exception handling etc and you should check on the PL/SQL forum to see if there are better examples!
Andy

Similar Messages

  • SDDM 3.3.EA2 one xml file for each table?

    Dear Philip!
    We'd like to have xml-files for all of our tables. To be more precise one xml file for each table so we can check it in in our configuration management system (CCC Harvest)
    Is it possible to write such a transformation script and, I really believe that can be done, can you please point us in the right direction, how to do that?
    Thanks in advance
    Guenter

    Hi Gunter,
    if you want each table to be stored in separate XML file then you needn't to do anything. Each table is stored in separate file in design directory structure - foreign keys are not included, each FK is stored in separate file.
    The ID of the table is used as file name. Each table has presentation in each physical model so you'll find file with same name (table ID) in each physical model.
    Please elaborate on that if you want something else.
    Philip

  • How to generate an XML file for an animation of IK armature

    Can someone please tell me how to generate an XML file for an animation of IK armature.
    I have a 5 keyframe/16 frame animation of a human character made up of a series of moveiclip symbols that is animated with an IK armature.  I need the XML information from the animation. 
    When I go to Commands > Export Motion XML I get the error message "There is more than one object on frame 1" and then nothing happens.
    Thank you,
    c

    I hope that's not the case.  I want to write to adobe about it.  I think it's a great feature and it functions really well even though it is not a very developed IK tool.  My biggest issue with it is ouput options and integration with motion tweens.
    I have seen a lot of examples of animators using it online, just no one talked about output.  I just feel it hasn't been developed.  It can generate a sprite sheet but only for a single pose frame of the animation, and not all the key frames or pose tweens.  I find that functionality quite odd, as if adobe just forgot about IK when added in sprite sheets, etc. and the reason it half works is just an accident.

  • How to create different log files for each of web applications deployed in OC4J

    Hi All,
    I am using OC4J(from Oracle) v1.0.2.2 and Windows2000. Now I want to know
    1. how to create different log files for each of my deployed web applications ?
    2. what are the advantages in running multiple instances of oc4j and in what case we should run
    multiple instances of OC4J ?
    3. how to run OC4J as Windows2000 Service rather than Windows2000 Application ?
    Thanks and Regards,
    Kumar.

    Hi Avi,
    First of all I have given a first reading to log4j and I think there will some more easy way of logging debugging messages than log4j (If you could provide me a detailed explanation of a servlet,jsp,java bean that uses log4j and how to use log4j then it will be very helpful for me). The other easy ways (if I am not using log4j) to my problem i.e creating different log files for each of web applications deployed in oc4j are
    I have created multiple instances of OC4J that are configured to run on different ports and so on each instance I have deployed a single web application . And I started the 2 oc4j instances by transferring thier error/log messages to a file. And the other way is ..
    I have download from jakarta site a package called servhelper . This servhelper is a thread that is started in a startup servlet and stopped in the destroy method of that startup servlet. So this thread will automatically capture all the system.out.println's and will print those to a file. I believe that this thread program is synchronized. So in this method I need not run multiple instances of OC4J instead each deployed web application on single instance of oc4j uses the same thread program (ofcourse a copy of thread program is put in each of the deployed web applications directories) to log messages on to different log files.
    Can you comment on my above 2 approached to logging debugging messages and a compartive explanation to LOG4J and how to use LOG4J using a simple servlet, simple jsp is appreciated ...
    Thanks and Regards,
    Ravi.

  • 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/

  • How to create an XML File for Gantt?

    Hi Everybody.
    I need a Gantt in Web Dynpro ABAP. I need it for the boss to do a Forecast for Vacation. I Hope this is understanding.
    Did Anyone know how can i create a XML File for the Gantt at runtime?
    Thanks
    MSi

    Hi Marcus,
    the following link is to the JNet/JGantt developer doco
    [JNet/JGantt Developer Documentation|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/lw/uuid/f010ec31-9658-2910-3c83-c6e62904eceb]
    included in this is the:
    [Schema for XML|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/lw/webdynpro/jnet_jgantt%20developer%20documentation/schema/xml-spy/jnet-schema.html]
    You can use this to build XML to represent a gantt like chart.
    I did this to build XML to represent employee avaliablity - although we fronted the gantt through WD Java not ABAP - the java applet called is the same (I believe).
    Don't underestimate the work required to tweek your data into a decent layout. It took me days.
    There may be tools/api to help generate the XML - I don't know of them - I'd look forward to seeing any other replies to this thread from people who have used/built any.  An example of a class that generates JNet XML - CL_SPI_UI_JNET - but this does not seem to be a Gantt display.
    Cheers,
    Chris

  • How to include one xml file into another

    Dear Sir/Madam!
    Could you do me a favour and help me to solve the problem like this:
    I have one xml file wich describe the common thins of the GUI, and the another will be generated depending on the point the user has selected.
    I would be very pleased for any helpful assistance.

    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml"/>
    <xsl:template match="/">
    <xsl:variable name="xml1" select="document('xml1.xml')"/>
    <xsl:variable name="xml2" select="document('xml2.xml')"/>
    <xsl:copy-of select="$xml1"/>
    <xsl:copy-of select="$xml2"/>
    </xsl:template>
    </xsl:stylesheet>

  • Different data-sources.xml files for each build

    Any thoughts on how to do this:
    I have two sets of data-sources. When I deploy the EAR to my stage box, I need to go to the "stage" data source of the other repositories. When I deploy the EAR to my production box, I need to use the production data sources for the other repositories
    I am using jdev 10.1.3
    There is a single data-sources.xml file - where, currently, I am manually editing the connection strings between deployments.
    I am using ant to build the EAR file.
    What is a more elegant way to do this?

    Use ANT script to build the EAR file.
    Have 2 different data-sources file one for production and one for stage.
    Based on the environment you want to deploy tell ANT to copy those files into the EAR.
    Just a suggestion.

  • How to create one primary key for each vendor

    Hi all
    i am doing IDOC to jdbc scenario
    i am triggering idoc from R/3 and the data is going into DB table vendor through XI.
    structures are as follows:
    sender side: ZVendorIdoc (this is a customized IDOC , if i triger IDOC for multiple vendors then it triggers only 1 idoc with multiple segment )
    Receiver side:
    DT_testVendor
        Table
            tblVendor
                action UPDATE_INSERT
                access                     1:unbounded
                    cVendorName         1
                    cVendorCode        1
                    fromdate                1
                    todate                    1
                 Key1
                    cVendorName         1
    if i trigger idoc for multiple vendors ,for example vendor 2005,2006 and 2010 . then i can see that the only key comes from the very first field (2005) and the whole record for vendor 2005,2006 and 2010  goes into the table with this(2005) as a primary key
    now again if i send data for these three vendor 2005, 2006 , 2010, in which record for the vendor 2005 is same and for 2006 and 2010 are different than it takes 2005 as a primary key and it does not update the data in the table.
    my requirement is like this:   for each vendor there should be one unique key assigned.
                                              for above said example there should come three keys one for each vendor .
    could you please help me how to do this???????????

    Hi,
      In Mapping Make the statement is 0-unbounded.For each vendor create a statement.This will solve your problem.
    Regards,
    Prakasu.M

  • How to create separate log files for each deployed web application in oc4j

    Hi All,
    I am using Windows2000, Oracle9iAS(OC4J). Say I have deployed 3 web applications onto this oc4j server. Then how to create 3 different log files so that I can see the log messages(System.out.println's) of each of these web appliations in a different log file.
    Thanks and Regards,
    Ravi.

    Where do the messages printed via ServletContext.log() go? Is this configurable separately by web application? If so, you could at least replace your System.out.println() with sc.log() statements. For exceptions, you could trap them and log them since the log() method takes a throwable as well as a String.
    John H.

  • Generate XML file for payroll result

    Hi,
    I tried to generate XML file for chinese payroll result by t-code: pu12, but i can not find the interface format for china payroll(here is format for other country vesion like international, france...). How can i generate xml file for chinese payroll result. DO i need to create a format type? Is there any other way? thank you in advance.

    Coming back to my question is it really possible to generate bigger XML on 9i.
    Sure. But not in one go.
    I would use SQL/XML functions instead and paginate the result set so that each CLOB chunk doesn't exceed 4GB (or less). Each chunk could then be appended to a file using UTL_FILE.
    Alternatively, as Oracle 9i supports parallel pipelined functions, you could also imagine doing the job in parallel using automatic data partitioning on an input ref cursor.
    That would require some postprocessing steps to rebuild the entire file from the different chunks though.
    See : Pipelined and Parallel Table Functions

  • How to Merge multiple XML  files in one file ( Env: XML Publisher 5.6.2)

    All,
    I have recently started working on XML publisher and have developed 3 reports in last 2 days using XML Publisher and integrating them with Concurrent programs.
    This is a great tool.
    I have got another requirement, where i need to use xml file generated by multiple run of same report with various parameters and then merge all xml file to a single report. Developing the whole custom process will take very long time and sure will have bugs in it. Instead i was thinking to use xml file generated by Oracle report itself.
    Report "US Gross to net summary" generates xml output in standard output directory and then show output in PDF file. I have 7 such file generated for each payroll. I want to merge output of xml into a single xml so that i can create single report having data from all 7 xml files showing me All payroll output in a single report.
    Can someone please guide me , how can i read xml file data from the output directory of a seeded concurrent program and how to manipulate data in it.
    Thanks
    Ankur

    Hi Tim,
    Thanks for replying. I have looked for "PDFBookBinder class" in xml publisher user guide for ver 5.6.2. I didn't get any reference of this text. Can you please guide me to a tutorial/link where i can get more information about this class.
    Also, i originally thought of similar to your second logic, as my design basis. Oracle process generates the xml file in output directory which i can get. What i didn't get is how do i "pick them up and merge" using publisher. Also, is there way to do this merging process using pl/sql ? Can you please give little more information on your second approach.
    My original plan of action is that i will create a report set in which i will call oracle seeded report for all 7 payrolls in a sequential manner. Then using the child requests of the report set i will get to 7 xml files generated by seeded oracle process. Then the piece i am not sure of , i will use those 7 files to generate a single xml file having payroll name as tree top for each output. Once single xml is ready, i can easily design a template and register the process to generate output as Excel.This process will not require me to actually change any data or do any calculation. It will only reformatting the feilds we see and abiity to see all 7 payroll at one time rather then entering these numbers manually into an excel to do analysis.
    Please provide your feedback, if you think above plan is not feasible or need corrections.
    Best Regards,
    Ankur

  • How to display more than one column with for each

    Hi guys,
    how to display more than one column with for each like below?
    for each
    Item1
    Item2
    Item3
    Item4
    Item5
    Item6
    Item7
    Item8
    Item9
    Item10
    End for each
    for each          
    Item1     Item2     Item3
    Item4     Item5     Item6
    Item7     Item8     Item9
    Item10          
    End for each

    Take a look at this to see if the solution provided would work for you: https://blogs.oracle.com/xmlpublisher/entry/multi_column_row_woes
    Won't you have more than 10 records in your data file ? If you are going to have only 10 items then you may be able to use position() function to limit it to 3 each..
    Take a look at this: https://blogs.oracle.com/xmlpublisher/entry/turning_rows_into_columns
    Thanks,
    Bipuser

  • If I have two email accounts, one personal hotmail account and one MS Exchange work account, how can I setup individual notifications for each account. Right now, any email from any account has the same notification. I want work to be different than perso

    If I have two email accounts, one personal hotmail account and one MS Exchange work account on my iPhone 4s, How can I setup individual notifications for each account? Fore example, if I get a work email, I want to hear a DING, DING....If I get a personal email, I want to hear a BEEP, BEEP. Right now, any email from any account has the same notification. I want work incoming email notification to be different than personal incoming notification. The only semi-workaround I've seen is just disable any notification for the Hotmail account, so only work emails would notify. But then I don't know when I get a personal email. Even the lowely Blackberry Torch 9800 has this feature..not iPhone 4s??
    Thanks

    Sorry you get only one notification sound for all email accounts.  you can send a suggestion to apple here http://www.apple.com/feedback/

  • How do I import one xml file into 3 separate tables in db?

    I need to utilize xslt to import one xml file into 3 separate tables: account, accountAddress, streetAddress
    *Notice the missing values in middleName, accountType
    sample xml
    <account>
    <firstName>Joe</firstName>
    <middleName></middleName>
    <lastName>Torre</lastName>
    <accountAddress>
    <streetAddress>
    <addressLine>myAddressLine1</addressLine>
    <addressLine>myAddressLine2</addressLine>
    </streetAddress>
    <city>myCity</city>
    <state>myState</state>
    <postalCode>mypostalCode</postalCode>
    </accountAddress>
    <accountId>A001</accountId>
    <accountType></accountType>
    <account>
    I need the following 3 results in 3 separate xml files in order for me to upload into my 3 tables.
    Result #1
    <rowset>
    <row>
    <firstName>Joe</firstName>
    <lastName>Torre</lastName>
    <accountId>A001</accountId>
    <row>
    <rowset>
    Result #2
    <rowset>
    <row>
    <addressId>1</address>
    <city>myCity</city>
    <state>myState</state>
    <postalCode>myPostalCode</postalCode>
    <row>
    <rowset>
    Result #3
    <rowset>
    <row>
    <addressId>1</addressId>
    <addressLineSeq>1</addressLineSeq>
    <addressLine>myAddressLine1</addressLine>
    <row>
    <row>
    <addressId>1</addressId>
    <addressLineSeq>2</addressLineSeq>
    <addressLine>myAddressLine2</addressLine>
    <row>
    <rowset>

    Use XSU to store in multiple tables.
    "XSU can only store data in a single table. You can store XML across tables, however, by using the Oracle XSLT processor to transform a document into multiple documents and inserting them separately. You can also define views over multiple tables and perform insertions into the views. If a view is non-updatable (because of complex joins), then you can use INSTEAD OF triggers over the views to perform the inserts."
    http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14252/adx_j_xsu.htm#i1007013

Maybe you are looking for

  • How to update multiple row using procedure in table

    Hi, create or replace procedure TESTLEDGER1(var_date varchar2) as var_date1 date; CURSOR C1 IS select DISTINCT ta.accountid,day PROCESSDATE, (NVL(payment,0))PAYMENT,NVL(TOTALDUE,0)TOTALDUE,NVL(currentbillamount,0)CURBILL,NVL(srf,0)SRF,NVL(sbpnt,0)sbp

  • Hey guys help me!! I lost XSkey..

    Today, I lost it.!! I don't have any idea to get new one... I must buy new Logic pro?? plz.. let me know what to do.. E-mail me... [email protected]

  • No Open If Statement

    Hi,   In my program, Iam getting the error that 'no open if statement'.Please correct me. Also please let me know the functionality of hide statement in this progra,. REPORT  ZMTSHPRG7                               . TYPES: BEGIN OF TY_KNA1, KUNNR TY

  • How do I find "Legacy JAVA SE 6" for my macbook?

    I downloaded Minecraft for my daughter to play and it won't open, stating that I need to download "Legacy JAVA SE 6" before I can run the game. Please help me find what I need to get the game up and running. When I click the link provided in the app

  • Master card personalisation Help needed

    Hi all, I am new to Master card and, would like to know the personalization steps for the Mastercard applet. Also what are the procedures (from where and how)for getting Mastercard applet for loading into a java card? I have smart card having Persona