Writing large xmltype data to UTL_FILE and setting max row per file

Hey Gurus,
I am trying to create a procedure (in Oracle 9i) that writes out xml data I have created into several xml files (file would probably be to large for one xml file output...I am doing this for 270,000 rows of data), setting the max rows to 1000 rows per file. I know one would have to create a looping contsruct to do this but I am just not adept enough in PL/SQL to figure it out at the moment.
So essentially their would be some sort of loop construct and substr process that creates a file after looping through 1000 rows and then continues the count and creates a another file until all 270 xml files are created. Simple enough right...lol? Well I've tried doing this and haven't gotten anywhere. My pl/sql coding skills are too elementary I am guessing. I've only been doing this for about three months and could use the assistance of a more experienced person here.
Here are the particulars...
This is the xmltype view code that I used to create the xml data.
select XMLELEMENT("macess_exp_import_export_file",
XMLELEMENT("file_header",
XMLELEMENT("file_information")),
XMLELEMENT("items",
XMLELEMENT("documents",
(SELECT XMLAGG(XMLELEMENT("document",
XMLELEMENT("external_reference"),
XMLELEMENT("processing_instructions",
XMLELEMENT("update", name)),
XMLELEMENT("filing_instructions",
XMLELEMENT("folder_ids",
XMLELEMENT("folder",
XMLATTRIBUTES(folder_id AS "id", folder_type_id AS "folder_type_id")))),
XMLELEMENT("document_header",
XMLELEMENT("document_type",
XMLATTRIBUTES(document_type AS "id")),
XMLELEMENT("document_id", document_id),
XMLELEMENT("document_description", document_description),
XMLELEMENT("document_date",
XMLATTRIBUTES(name AS "name"), document_date),
XMLELEMENT("document_properties")),
XMLELEMENT("document_data",
XMLELEMENT("internal_file",
XMLELEMENT("document_file_path", document_file_path),
XMLELEMENT("document_extension", document_extension)
))))from macess_import_base WHERE rownum < 270000))))AS result
from macess_import_base WHERE rownum < 270000;
This is the Macess_Import_Base table that I am creating xml data from
create table MACESS_IMPORT_BASE
MACESS_EXP_IMPORT_EXPORT_FILE VARCHAR2(100),
FILE_HEADER VARCHAR2(20),
ITEMS VARCHAR2(20),
DOCUMENTS VARCHAR2(20),
DOCUMENT VARCHAR2(20),
EXTERNAL_REFERENCE VARCHAR2(20),
PROCESSING_INSTRUCTIONS VARCHAR2(20),
PATENT VARCHAR2(20),
FILING_INSTRUCTIONS VARCHAR2(20),
FOLDER_IDS VARCHAR2(20),
FOLDER_ID VARCHAR2(20),
FOLDER_TYPE_ID NUMBER(20),
DOCUMENT_HEADER VARCHAR2(20),
DOCUMENT_PROPERTIES VARCHAR2(20),
DOCUMENT_DATA VARCHAR2(20),
INTERNAL_FILE VARCHAR2(20),
NAME VARCHAR2(20),
DOCUMENT_TYPE VARCHAR2(40),
DOCUMENT_ID VARCHAR2(64),
DOCUMENT_DESCRIPTION VARCHAR2(200),
DOCUMENT_DATE VARCHAR2(100),
DOCUMENT_FILE_PATH VARCHAR2(200),
DOCUMENT_EXTENSION VARCHAR2(200)
Directory name to write output to "DIR_PATH"
DIRECTORY PATH is "\app\cdg\cov"
Regards,
Chris

I also would like to use UTL_FILE to achieve this functionality in the procedure.

Similar Messages

  • I have to average data of 1min and then log into text file

    For my application i have to average data of 1min and then log into text file. please guide me on this . To transfer the data i am using notifier.
    Prashant Soni
    LabVIEW Engineer

    hi prashant,
      Check this attachment..I just implemented my idea    in this one.
    Thanks and regards,
    srikrishnaNF
    Attachments:
    Example_VI_BD.png ‏12 KB

  • Pagination disappears after setting 'max row count'

    I have a report with app. 4500 records (with the default of 15 lines per page) and a pagination scheme of 'Row Ranges 1-15 16-30 in select list (with pagination)'.
    When running the report, all is working fine and i get the information in the select list '.. of more than 500'.
    Then i inserted some values in the 'max row count'-field:
    a value of 2000: it's working as expected
    a value of 4000 (or more): the pagination disappears and won't be desplayed :-(
    Any ideas, what i have done wrong?
    Thanks
    Rainer

    Hi
    This problem - select list dissapearing when > 32k still persists in Version 3.
    A neat workaround is to use a page item to set the number of rows disaplyed.
    Where there is a large number of rows in the table and the max rows is also large, simply set the page item value for the number of rows to a larger value say 200 - then - if the select list now becomes less than 32K the select list will be shown.
    It's a matter of balancing the number of rows shown on the page with the total number of rows in the table / max rows combination.
    It's not perfect but it works.
    Hope this helps.
    Mike Mac
    Message was edited by:
    Mike Mac

  • How to set Max Rows Retrieved by user security profile in CMC?

    Hi
    As we know, it is possible to set Max Rows Retrieved with query property (in the area 'Limits').
    However, it is mentioned in official documents that this setting can be overwritten by the BOE administrator in user security profile. Could any one tell me how this is done in CMC?
    Thanks in advance!
    Qing

    Hi Rishit,
    Thanks for your answer!
    Had a long holiday, so didn't give a feedback in time. Sorry for that!
    There is a tab 'Controls' in Universe Parameter, where there is a setting used to limit the size of result set.
    Then what's the priority between this setting and the similar setting in WebI query properties?
    However, acutally my question is how to set the limitation by user security profile in CMC.
    Do you have any idea about it?
    Qing
    Edited by: Qing Zhou on Jun 21, 2010 11:12 AM

  • How to set max row display rows in PO's PLD

    Hi,
    How to set max row display rows in PO's PLD
    Thanks and Best Regards
    Bruce

    Hi
    Max. Rows per Page is depend on PLD Settings and Depend on Repetitive Area Fieds Height.
    Try this,
    1st Case:
    ->> Administration Module.
    ->> System Initialization.
    ->> Open the Print Perferences Window.
    ->> Click General Tab on Print Perferences Window.
    ->> Assign the Max. Rows per Page - 99 (or) your wishes.
    ->> Update the Print Perferences.
    2nd Case:
    ->> Open your PLD.
    ->> Choose Repetitive Area on Field Index Window.
    ->> Click Format Tab on Properties Area Window.
    ->> Assign the Lines in Repetitive Area - Your Wishes .
    ->> Save the PLD.
    Regards,
    Madhan.

  • Errors and exceptions in writing large binary data on sockets!!! urgent

    hi
    I am trying to write large binary data in the form of byte arrays on sockets.
    Data is as large as 512KB(== 524288bytes) So i store the data (actually read from a file through FileInputStream ) and then write on the socket with lines like this
    DataOutputStream dos =
    new DataOutputStream(new BufferedOutputStream(sock.getOutputStream()));
    dos.write(b);
    /* suppose b is the arrayreference in which data is stored. sometimes i write with that offset + len function*/
    dos.flush();
    dos.close();
    sock.close();
    but the program is not stable: sometimes the whole 512KB is read on other side and sometimes less usually 64KB.
    The program is unthreaded.
    There is another problem : one side(reading or writing) sometimes gives error :
    java.net.SocketException: Software caused connection abort: socket write error
    please reply and reply soon and give ur suggestions
    thanks

    hi
    I am trying to write large binary data in theform
    of byte arrays on sockets.
    Data is as large as 512KB(== 524288bytes) So istore
    the data (actually read from a file through
    FileInputStream ) and then write on the socketwith
    lines like this
    DataOutputStream dos =
    new DataOutputStream(new
    BufferedOutputStream(sock.getOutputStream()));
    dos.write(b);
    /* suppose b is the arrayreference in which datais
    stored. sometimes i write with that offset + len
    function*/
    dos.flush();
    dos.close();
    sock.close();
    but the program is not stable: sometimes the whole
    512KB is read on other side and sometimes less
    usually 64KB.
    The program is unthreaded.
    There is another problem : one side(reading or
    writing) sometimes gives error :
    java.net.SocketException: Software caused
    connection abort: socket write error
    please reply and reply soon and give ursuggestions
    thanksUmm how are you reading the data on the other side?
    some of your code snippet might help. Your writing
    code seems ok. I've written a file transfer program
    in a similar fashion and have successfully testing on
    different platforms (AIX, AS400, Solaris, Windows,
    etc) without any problems and without needing to set
    the buffer sizes with files as large as 600MB and you
    said you're testing this on the loopback?
    Point here is you should never need to reset any of the default TCP options to get program correctness. The options are more for optimizations and fine tuning. If indeed you need to change the options to get your program to work, then you program wont be able to scale under different load.

  • API to access and set properties for MP4 files

    I am looking for some APIs in Visual C++ to use in Visual Studio to set
    and get properties for .mp4 files. Can anyone help me in this regard?

    Hi Rahul,
    Try using the Windows Media Format SDK with help from the below document:
    http://blogs.msdn.com/b/tims/archive/2004/03/28/extracting-metadata-from-windows-media-files.aspx
    Alternatively, you can give a try to ffmpeg libraries for a open source alternative.
    https://www.ffmpeg.org/download.html
    (Please mark as answer if this solves your query. Please upvote if this reply is helpful).
    Regards,
    Rajesh Nath

  • LOV switcher and set current Row

    Hi
    I have a LOV switcher attached to one of the columns in the view object.
    It works fine while switching the LOV's in mostly all conditions.
    But its failing for one case.
    We are using checkboxex to select a row , and do a operation in the row.
    To do this, the button on which the operation is performed ...
    1)we have checked which row has the transient value of check box as checked
    2) Set the current row of the iterator to the row that comes from the selected check box index..
    3) Called the operation.
    But as the code go to step two and the current row is set to the required row, all the LOV 's in all the rows start showing the Default LOV which is selected in the LOV switcher, if i do a f5 fr the page, the original values are restored.
    Also if the VO fecth size is 25 , it gives wrong value for 25 rows, if i scroll through the table again it automatically shows the correct value.
    This has been taking a lot of out time to debug the issue.
    I guess its somethng to do with LOV switcher , set current row and the table getting refreshed incorrectly on set current row

    Hi Timo ,
    Thanks fr the reply..
    Jdev 11.1.1.4
    Code for checkbox selection
    DCBindingContainer dcbindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterator =
    dcbindings.findIteratorBinding(iteratorName);
    Row[] rowSet = iterator.getAllRowsInRange();
    Integer selectCount = 0;
    for (Row row : rowSet) {
    Object selAtt = row.getAttribute(selectAttribName);
    if (selAtt != null && (Boolean)selAtt == true) {
    System.out.println("Row selected");
    selectCount++;
    if (selectCount > 1) {
    System.out.println("More than one row selected!");
    throw new ValidationException("More than one row selected");
    else{
    iterator.setCurrentRowWithKey(row.getKey().toStringFormat(true));
    } else {System.out.println("Row not selected");}
    I actually sorted the issue out
    had to write
    iterator.refresh(Row.REFRESH_CONTAINEES); after iterator.setCurrentRowWithKey(row.getKey().toStringFormat(true));
    But not sure if thts correct ...

  • Set Maximum Rows Per Page not working

    I want to display 50 rows per page and I tried the below but still I can see the default 15 rows per page.
    Home>Application Builder>Application 301>Page 51>Interactive Report Attributes>Search Bar>Maximum Rows Per Page
    Set to = 50
    Home>Application Builder>Application 301>Page 51>Interactive Report Attributes>Search Bar>Rows Per Page Selector
    Removed the check mark and still shows 15 rows per page.

    Run your report. Set the Rows to 50. Press Go. Select 'Save Report' from the 'magic wheel' menu and next select 'Save as default report settings'.
    It is a rather long way, but seems the only one...
    Roel

  • Setting max record per page property at runtime (very urgent)

    We need to display 7 record for first page and 25 for other pages...
    we tried a reperating frame max record per page property is a report level property. So it cannot change for pages.
    Then We try other way..
    we seperated our query to the different frame to do these
    But we need to summaries some field at page level and
    reset at page has fallowing restriction
    "A Reset At of Page will not work for reports that have multiple repeating frames associated with a group that is involved in the summary. One common case of this is a matrix report. As a result, matrix reports cannot have page-level summaries."
    So all the ways we tried failed.
    How can we do this ... it is very urgent. (we can use any version of report.)
    Thanks for your help...

    repost

  • How to set Max Rows when I search extended attribute in Admin Setting?

    When I search extended attributes in Admin Setting, the default max row is 500.
    Can I change the Max rows' Setting?
    Thanks

    We don't have a feature config for this in the core application, however you can adjust the 500 limit using a ready report.  Ready Reports is a solution pack that allows you to create saved searches in the form of reports.  You can get the ready reports solution pack in the latest extensibility pack.

  • Query Data From Database and set Visibility Accordingly

    Hi there,
    i have a case where i have to set the rendered property of some items on my screen according to values retrieved from an sql statement.
    When i change a value in a listbox, that value must be given to an sql statement as a parameter (select field_id fom table where id = the value in the list box) to query the ids of the fields from a database table . (each id of a field in my jsf page has the same value in that database table).
    For each record retrieved in that query, the field's rendering having that id must turn to false.
    Anyone can give me a solution to my urgent problem ? ( Where do i write the select statement and the loop and how ... )

    Hi,
    what comes to my mind is to create a custom version of HashMap (extend HashMap) and override the get method. The configure this custom Hashmap as a managed bean. Usually you cannot pass arguments in EL, but for HashMaps this is doable by overriding the get method (at least I remember having done this before).
    So in your EL rendered property value you do
    #{managedHashMapBean["nameOfFieldId"]
    In the bean you just check if the ID exists and if it doesn't return true. So all that your query needs to do is to populate the internal state of the hashmap with the IDs that should be false.
    Frank

  • Acquiring data(10 chanels) and save them in 10 files (*.wave format ) in 1hours

    I have some problems that :
    -  I have to acquire data from 10 chanels (acquiring continuously- Analog Input) , show them on the graphic and save each one in each *.wav file format ( Total : 10 file )
     I need LabView code to solve my problems
    Now I use : - DAQcard  6036E
                       - LabVeiw  7.0
                      - Window : 2000
    Please help me ! Hurry up ! Thank you very much !

    Hello ChieBK,
    There are shipping examples that would allow you to acquire from analog
    input. All you will need to do is change a few things to make it
    acquire from 10 channels. The example I attached below shows how you
    can acquire from 10 channels (configured in RSE since you may not have
    enough channels to do differential) and how to split up the channels
    and save in separate files. I am saving 4 channels. I do recomment
    though that you save all the channels in a single file since it will be
    more performent.
    Good luck.
    Attachments:
    Cont Acq&Graph Voltage-Int Clk Filr.vi ‏436 KB

  • How can I merge cells and set their row hight in numbers with applescript

    Hi,
    I have a table in numbers that looks like this (but without header):
    Column A
    1
    1 ABC GHDD
    2
    efgh dhdh
    3
    lmnk hdjdhj
    4
    5
    2 HGJKSKJHD
    6
    HKD KIEIJE JEIj
    7
    G8DIHE  EO E PE
    8
    GDDH OEJ EEF
    9
    10
    3 DHKJDH  D JH D KJH D
    11
    I want to merge all the cells that belong to a number with the following cells until an empty cell comes. In this example cells 1-3, 5-8. After I merged these I want to set their height to 1.
    Is this possible with apple script? I tried it, but apple script says "can't get height".
    Do you guys have any idea?
    Thanks Frieddy

    Thanks for the reply!
    I want to merge just the rows, there is only one column (I had to do the number column in the example to point to the rows I meant).
    I would like the whole thing to look like this:
    1
    1 ABC GHDD
    efgh dhdh
    lmnk hdjdhj
    2
    2 HGJKSKJHD
    HKD KIEIJE JEIj
    G8DIHE  EO E PE
    GDDH OEJ EEF
    3
    3 DHKJDH  D JH D KJH D
    Frieddy

  • Writing the hashtable content (both keys and values) into a text file

    Hello,
    I have a hashtable which have some keys and respective values in it. Now I want to write all thoses content into a text or log file. Can anyone please tell me how to write it.
    thanks,
    chaitanya

    Properties is a subclass of Hashtable. It'll probably work just fine as a drop-in replacement.
    Otherwise...if all keys and values are text, then loop through the Entry objects in the Map in question (Hashtable is a Map, and you probably shouldn't be using Hashtable anyway), or loop through the keys and grab the corresponding value for the keys. Read the API docs for java.util.Map. It's pretty straightforward.

Maybe you are looking for

  • Win 7 preinstalled through downgrade rights in Win 8 Pro 64

    My new T430s has Win 7 Pro preinstalled via downgrade rights in Windows 8 Pro.  I assume this means the recovery media on the machine is for Win 7(?).    Since the machine apparently has a Win 8 Pro license that has been downgraded, what is the proce

  • Migration assistant to transfer data from PC - Windows 7 to MAC Book Pro running Mavericks

    Hello Gurus, I am having toruble using the migration assistant to transfer my data from my PC windows 7 to MAC book pro Mavericks..... The MAC window for migration assistant keeps searching the source computer..... and windows PC says waiting for the

  • Copying SQL Server Agent - Jobs in SSMS - 2012

    Hi, I am using SQL 2012 version. when i try to copy the existing sql agent job (job "X") (using, Script Job As--> Create To--> New query window) and paste it into different database it is giving me some errors as below. (this method is working fine w

  • Change the cardinality of a database diagram

    Is it possible to change the cardinality in the database diagram. I tried double clicking the lines etc nothing worked. the default that comes up when i put a foreign key is not always right.

  • Jagged edges on rotated picture boxes

    It seems as though it's a bug. As I rotate imported images the outer edge and hard edges in the actual images are noticably jagged. As in the example. Any suggestions?