UTL_FILE.get_line won't read large files ?

I am trying to read a large fixed length flat file. If I cut the file down to really small it will read it but it reads it as a single line. If I try to read a larger file > 32k I get a READ_ERROR. I am pretty sure it has to do with the end of line marker but I saw nothing about that in the UTL_FILE documentation. This is on UNIX, new line character after each record in the file. Standard unix flat file.
Any ideas on what to do?
Thanks in advance
Matt
[email protected]
my code:
BEGIN
BEGIN
std_file := UTL_FILE.FOPEN('&4','&1','r',32767);
EXCEPTION
WHEN UTL_FILE.INVALID_PATH THEN
RAISE_APPLICATION_ERROR(-20011,'Invalid Path for STD file, &4/&1');
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(-20014,'Other Error trying to open STD file, &4/&1');
END;
IF UTL_FILE.is_open(std_file) = FALSE THEN
RAISE_APPLICATION_ERROR(-20015,'Could not open STD file, &4/&1');
END IF;
-- READ STD FILE HEADER
BEGIN
UTL_FILE.get_line(std_file,hdr_text);
EXCEPTION
WHEN UTL_FILE.INVALID_FILEHANDLE THEN
RAISE_APPLICATION_ERROR(-20017,'STD read file handle not valid');
WHEN UTL_FILE.INVALID_OPERATION THEN
RAISE_APPLICATION_ERROR(-20018,'STD read invalid operation error');
WHEN UTL_FILE.READ_ERROR THEN
RAISE_APPLICATION_ERROR(-20019,'STD read error');
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(-20020,'STD read no data found');
WHEN VALUE_ERROR THEN
RAISE_APPLICATION_ERROR(-20021,'STD read value error');
END;
-- PROCESS TRANSACTIONS
LOOP
BEGIN
tran_text := NULL;
UTL_FILE.get_line(std_file,tran_text);
EXCEPTION
WHEN no_data_found THEN EXIT; -- EOF
WHEN value_error THEN
RAISE_APPLICATION_ERROR(-20010,'STD record too long.');
END;
std_rowcount := std_rowcount + 1;
END LOOP;
UTL_FILE.FCLOSE(std_file);
EXCEPTION
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(-20001,'No Data Found.');
WHEN UTL_FILE.INVALID_PATH THEN
RAISE_APPLICATION_ERROR(-20002,'Invalid Path ');
WHEN UTL_FILE.INVALID_MODE THEN
RAISE_APPLICATION_ERROR(-20003,'Invalid Mode ');
WHEN UTL_FILE.INVALID_OPERATION THEN
RAISE_APPLICATION_ERROR(-20004,'Invalid Operation ');
END;
null

We are still hung up on this. I tried implementing the code from STEVE'S XML book but still haven't resovled it.
The clob is being created via XSU see below. The new char[8192] appeasr to force the output file to 8K
with trailing characters on small clobs but adds a carraige return each 8K on larger ones.
As usual any input is appreciated from all. Doese anyone know of a good JAVA forum like this one?
Thanks
PROCEDURE BuildXml(v_return OUT INTEGER, v_message OUT VARCHAR2,string_in VARCHAR2,xml_CLOB OUT NOCOPY CLOB) IS
queryCtx DBMS_XMLquery.ctxType;
Buffer RAW(1024);
Amount BINARY_INTEGER := 1024;
Position INTEGER := 1;
sql_string     VARCHAR2(2000) := string_in;
BEGIN
v_return := 1;
v_message := 'BuildXml completed succesfully.';
queryCtx := DBMS_XMLQuery.newContext(sql_string);
xml_CLOB := DBMS_XMLQuery.getXML(queryCtx);
DBMS_XMLQuery.closeContext(queryCtx);
EXCEPTION WHEN OTHERS THEN
v_return := 0;
v_message := 'BuildXml failed - '||SQLERRM;
END BuildXml;
create or replace and compile java source named sjs.write_CLOB as
import java.io.*;
import java.sql.*;
import java.math.*;
import oracle.sql.*;
import oracle.jdbc.driver.*;
public class write_CLOB extends Object
public static void pass_str_array(oracle.sql.CLOB p_in,java.lang.String f_in)
throws java.sql.SQLException, IOException
File target = new File(f_in);
FileWriter fw = new FileWriter(target);
BufferedWriter out = new BufferedWriter(fw);
Reader is = p_in.getCharacterStream();
char buffer[] = new char[8192];
int length;
while( (length=is.read(buffer)) != -1) {
out.write(buffer);
is.close();
fw.close();
/

Similar Messages

  • File Adapter Not Reading Large Files

    Dear Experts,
    Enviornment :-
    OS:-Linux
    Jdeveloper:- 11.1.1.6
    SOA:-11.1.1.6
    Weblogic:-10.3.6
    JDK:-SUN
    Allocated RAM:-16GB
    Currently we are in UAT Phase and now we are facingan  issue in reading large file.Below is the Design details of the service
    FileAdapter(Read)-->Bpel(Business login,Using FlowN)-->FileAdapter(Write CSV),JMS Adapter(AQ JMS topics)
    In this case at the time of read itself we are facing issue. File adapter reading xml file but in receive activity receives input data as
    xmlDocKey:1C135990067411E3BFA6B5087B629F9DI
    I really couldn;t understand about the error. Even i tried reading as Opaque format and still end up with same error.
    In order to make sure i have create mediator and tried reading the file, in case i was able to read file upto 15mb with out any error.Also i tried as  "read as Attachment" in Bpel component and able to read the attachment upto 7 mb file, but this is hitting the performance side.
    I request some one please let me know why the file adapter is giving XmlDOCKey rather then XMLContent to the inputvariable
    Regards,
    Tarak

    Can you check your BPEL Properties in EM?
    Go to Soa-infra > right Click > SOA Administration > BPEL properties
    increase the Dispatcher Engine Thread = 10, Dispatcher Invoke Threads = 60 and Dispatcher Engine Threads to 90
    Click on "More BPEL Configuration Properties"
    Increase the  DispatcherMaxRequestDepth from 600 to 1000.
    Bounce the server and see if works..
    Bounce the server and try again.
    If this fails, try get a threshold by increasing the file size until it fails again. 

  • DNG Converter suddenly stopped working, won't read NEF files

    Hi all, I'm new here, but am looking for some help.
    I currently am on a mac book and run photoshop CS3. I've been shooting with a nikon d700 in raw. When I upload the photos to my computer I've previously run them through the DNG converter without a problem. Now, for the past two days it has just stopped working. When I try to convert the NEF files, they are just greyed out, I can't select anything. I tried reinstalling the DNG converter, but still no luck.
    I never had any issues with it before, and now it suddenly won't read my files. Any ideas what could be wrong?
    Thank you!

    nfietz wrote:
    …When I upload the photos to my computer I've previously run them through the DNG converter without a problem…
    Had you run the DNG on a Mac before?  On the Mac, the DNG Converter works on folders only, not on individual files (unless you use the Finder to drop the icons of your raw files on the DNG Converter application icon).  From within the application, using File > Open, the icon and names of individual raw files will always appear grayed out.
    You need to target the folder that contains the files you want to convert.
    CAVEAT: all eligible files in the folder will be converted, including any and all DNG files that may already be contained in the folder.  So if you have any DNGs in that folder, they will also be converted again and the original DNGs may be overwritten.
    Wo Tai Lao Le
    我太老了
    Message was edited by: Tai Lao

  • Photoshop CS5.1 won't read raw files from Canon EOS M

    Photoshop cs5.1 won't read raw files from canon eosM, what to do?

    The EOS M requires at least Camera Raw 7.2 but Raw 7.2 is only compatible with CS6 or higher (CS5 is only compatible up to Raw 6.7)
    http://helpx.adobe.com/creative-suite/kb/camera-raw-plug-supported-cameras.html
    To open and edit Raw files, either upgrade to CS6 or join the Cloud and get the CC version.
    Alternatively convert the Raw files from the EOS M to DNGs using the free DNG converter then edit the DNGs in CS5.1
    http://www.adobe.com/products/photoshop/extend.displayTab2.html
    See also the Camera Raw FAQ
    http://forums.adobe.com/thread/311515?tstart=0

  • Reading large file with JCA Adapter in OSB

    Hello,
    We are searching for a solution how to read large file (>50M) from network drive and deliver it to queue via OSB 11gR4 (10.3.4). The problem is when reading the file with JCA File Adapter. It seems that it cannot handle as large files as we have. The documentation provides a way to bypass file size limitation by using Chunk Read but it seems to require BPEL Process execution which is not possible in our environment. Does anyone know if there are ways to implement this without having BPEL Process?
    Our usecase:
    read file from network drive -> transfer with OSB -> deliver MQ
    Other options than JCA File Adapter can be considered, if anyone can advice...

    If it's a plain routing use case and no message processing is required then you may simply use OSB's FILE transport instead of JCA adapter. Create a messaging type proxy service and select request message type as "binary". Also enable the content streaming (Disk buffer, compression).
    From OSB Dev guide -
    Oracle JCA Adapter for FTP and Files – Attachments (large payload support), pre- and post-processing of files, using a re-entrant valve for processing ZIP files, content streaming, and file chunked read are not supported with Oracle Service Bus.
    http://download.oracle.com/docs/cd/E17904_01/doc.1111/e15866/jca.htm#BABBICIA
    You may also refer -
    Reading huge flat file in OSB 11gR1
    Regards,
    Anuj

  • Lightroom v2 won't read RAW files from Sony A77

    Hi there - just got a new Sony A77 but Lightroom v2 won't read RAW files when I try to import them.  I know I need to upgrade my version of LR (I will be going to v4) but... is there ANYTHING else I need to do or to upgrade in order to ensure Lightroom 4 will read those Sony RAW files?  Thanks!

    I don't keep track of what cameras are supported in what versions.  But, IF your camera is supported by the latest DNG converter, you could use it to create digital negative copies of your images.  Those DNG files can then be opened in the version that you have now.  You won't get anywhere near the development quality that you will get with Lightroom 4, but at least you can work on your images with what you have now.
    And if Lightroom 4 supports your camera, that is the only thing you can do to "ensure" that you can use your files.  Of course, if you modify them now with the version that you have, you can leave them with those adjustments when you upgrade to Lightroom 4, but if you want to use the new adjustments and the improved develop tools you'll probably have to basically start over on any images that you want to convert to the new PV 2012.

  • Elements 9 failure to read large files.

    I recently purchased a Nikon D5300. I was a previous D50 user and always saved and converted RAW NEF files with Elements 9. The D5300 save 24Mb NEF files and Elements 9 would not read these files. I chanded to save RAW and JPEG files and it would not read those either. It will read lower res JPEG files. Is there an update to Elements 9 to alllow reading larger files?
    Bob Jacobson
    [email protected]

    Here's an interesting take on the "dependent operation failure" error message
    Adobe CS5: Payload cannot be installed due to dependent operation failure

  • Reading large files -- use FileChannel or BufferedReader?

    Question --
    I need to read files and get their content. The issue is that I have no idea how big the files will be. My best guess is that most are less than 5kb but some with be huge.
    I have it set up using a BufferedReader, which is working fine. It's not the fastest thing (using readLine() and StringBuffer.append()), but so far it's usable. However, I'm worried that if I need to deal with large files, such as a PDF or other binary, BufferedReader won't be so efficient if I do it line by line. (And will I run into issues trying to put a binary file into a String?)
    I found a post that recommended FileChannel and ByteBuffer, but I'm running into a java.lang.UnsupportedOperationException when trying to get the byte[] from ByteBuffer.
    File f = new File(binFileName);
    FileInputStream fis = new FileInputStream(f);
    FileChannel fc = fis.getChannel();
    // Get the file's size and then map it into memory
    int sz = (int)fc.size();
    MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, sz);
    fc.close();
    String contents = new String(bb.array()); //code blows up
    Thanks in advance.

    If all you are doing is reading data I don't think you're going to get much faster than InfoFetcher
    you are welcome to use and modify this class, but please don't change the package or take credit for it as your own work
    InfoFetcher.java
    ==============
    package tjacobs.io;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.ArrayList;
    import java.util.Iterator;
    * InfoFetcher is a generic way to read data from an input stream (file, socket, etc)
    * InfoFetcher can be set up with a thread so that it reads from an input stream
    * and report to registered listeners as it gets
    * more information. This vastly simplifies the process of always re-writing
    * the same code for reading from an input stream.
    * <p>
    * I use this all over
         public class InfoFetcher implements Runnable {
              public byte[] buf;
              public InputStream in;
              public int waitTime;
              private ArrayList mListeners;
              public int got = 0;
              protected boolean mClearBufferFlag = false;
              public InfoFetcher(InputStream in, byte[] buf, int waitTime) {
                   this.buf = buf;
                   this.in = in;
                   this.waitTime = waitTime;
              public void addInputStreamListener(InputStreamListener fll) {
                   if (mListeners == null) {
                        mListeners = new ArrayList(2);
                   if (!mListeners.contains(fll)) {
                        mListeners.add(fll);
              public void removeInputStreamListener(InputStreamListener fll) {
                   if (mListeners == null) {
                        return;
                   mListeners.remove(fll);
              public byte[] readCompletely() {
                   run();
                   return buf;
              public int got() {
                   return got;
              public void run() {
                   if (waitTime > 0) {
                        TimeOut to = new TimeOut(waitTime);
                        Thread t = new Thread(to);
                        t.start();
                   int b;
                   try {
                        while ((b = in.read()) != -1) {
                             if (got + 1 > buf.length) {
                                  buf = IOUtils.expandBuf(buf);
                             int start = got;
                             buf[got++] = (byte) b;
                             int available = in.available();
                             //System.out.println("got = " + got + " available = " + available + " buf.length = " + buf.length);
                             if (got + available > buf.length) {
                                  buf = IOUtils.expandBuf(buf, Math.max(got + available, buf.length * 2));
                             got += in.read(buf, got, available);
                             signalListeners(false, start);
                             if (mClearBufferFlag) {
                                  mClearBufferFlag = false;
                                  got = 0;
                   } catch (IOException iox) {
                        throw new PartialReadException(got, buf.length);
                   } finally {
                        buf = IOUtils.trimBuf(buf, got);
                        signalListeners(true);
              private void setClearBufferFlag(boolean status) {
                   mClearBufferFlag = status;
              public void clearBuffer() {
                   setClearBufferFlag(true);
              private void signalListeners(boolean over) {
                   signalListeners (over, 0);
              private void signalListeners(boolean over, int start) {
                   if (mListeners != null) {
                        Iterator i = mListeners.iterator();
                        InputStreamEvent ev = new InputStreamEvent(got, buf, start);
                        //System.out.println("got: " + got + " buf = " + new String(buf, 0, 20));
                        while (i.hasNext()) {
                             InputStreamListener fll = (InputStreamListener) i.next();
                             if (over) {
                                  fll.gotAll(ev);
                             } else {
                                  fll.gotMore(ev);
         }

  • Palm Desktop 6.2 won't read data file after IR synch with IIIC

    I have Windows 7, an old IIIC, and Palm Desktop 6.2. Since I can use a USB with that combination, I synced with an infrared connection. The files made it to the Palm directory, but the desktop program won't read them. My previous version of Palm Desktop allowed me to search for the data directory, but I can't find a way to do so with 6.2. And, no, the older version wouldn't display the data, either, in spite of my specifying the path.
    I'm so close! One more step and I won't have to buy a smart phone and pay a monthly fee to carry around my contact date. Please help.

    Palm Desktop 6.2.2 is not an upgrade to 4.x!   It was designed to fix the things Microsoft broke when Vista was born.
    It lacks many features that existed for many years in the 4.x versions.
    I'd suggest doing a Clean Uninstall and reinstall your original version!
    http://forums.palm.com/t5/Windows-HotSync/Instructions-for-a-Clean-Uninstall-of-Palm-Desktop-on-Wind...
    WyreNut
    I am a Volunteer here, not employed by HP.
    You too can become an HP Expert! Details HERE!
    If my post has helped you, click the Kudos Thumbs up!
    If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you asked!

  • Compiler won't read modified files

    Does anyone know why Flash would suddenly stop loading
    recently saved class files?
    Until now, I've been able to make changes to an Actionscript
    file, save the file, and then test the SWF to see the changes.
    Now it seems as though the modified files are not getting
    read by the compiler. To see the changes, I need to restart Flash
    (even then, there's no guarantee).
    My guess is that I've inadvertantly changed a setting
    somewhere.
    Anyone know what gives?

    Aperture 3.5.1 and the camera is the Olympus OM-D E-M5.
    And yes, Aperture will convert the RAW/ORF files but the devil is in the details. And since you asked (sort of), here are the details:
    I own and have happily used Photoshop CS4 for the layered compositing I like to do, but it won't support ORF files
    I tried importing/converting them in Aperture then editing in PS4 ... but Aperture 3 and PS4 don't play together well, so many come back as "unsupported file format"
    Apple can't fix the problem and Adobe no longer supports PS4... put another way, Apple can't do anythig but they care, and Adobe could do everything but they don't care
    It got worse when I upgraded to Mavericks, so to get around that I had to upgrade to Photoshop CC and pay the monthly "rental"
    Aperture and Photoshop now work, but the demands of running them both are beyond my aging iMac that can't be upgraded, so I have to buy a new one, but the monthly fee (which everybody assumes will only go up in cost)  + purchase of a new iMac for a guy on a fixed income are too much
    So, I thought if I used DNG to convert the ORF files I could import them into Aperture for all the basics and organization, then use PS4 for the compositing... but Aperture won't read the DNG conversions.
    And that, as the man used to say, is the name of that tune,
    Brian

  • Cwm won't read configuration files

    i built cwm from source and it won't seem to accept configuration. either from ~/.cwmrc or -c /path/file.
    i've tried various different .cwmrc's, from full configs to just one bind, but it won't seem to take it.
    any tips from cwm users on what i might be doing wrong? google hasn't yielded any answers.

    Did you build cwm or cwm-git? The plain cwm in the AUR won't read .cwmrc; you need to use cwm-git. If you did not buld from the AUR, where did you get the source?
    Last edited by 2ManyDogs (2013-10-03 17:33:18)

  • Aperture won't read DNG files

    I'm sure there's a simple solution I've missed, but Aperture 3 won't open DNG files converted from Olympus RAW (ORF). Any suggestions?
    Brian

    Aperture 3.5.1 and the camera is the Olympus OM-D E-M5.
    And yes, Aperture will convert the RAW/ORF files but the devil is in the details. And since you asked (sort of), here are the details:
    I own and have happily used Photoshop CS4 for the layered compositing I like to do, but it won't support ORF files
    I tried importing/converting them in Aperture then editing in PS4 ... but Aperture 3 and PS4 don't play together well, so many come back as "unsupported file format"
    Apple can't fix the problem and Adobe no longer supports PS4... put another way, Apple can't do anythig but they care, and Adobe could do everything but they don't care
    It got worse when I upgraded to Mavericks, so to get around that I had to upgrade to Photoshop CC and pay the monthly "rental"
    Aperture and Photoshop now work, but the demands of running them both are beyond my aging iMac that can't be upgraded, so I have to buy a new one, but the monthly fee (which everybody assumes will only go up in cost)  + purchase of a new iMac for a guy on a fixed income are too much
    So, I thought if I used DNG to convert the ORF files I could import them into Aperture for all the basics and organization, then use PS4 for the compositing... but Aperture won't read the DNG conversions.
    And that, as the man used to say, is the name of that tune,
    Brian

  • Adobe reader 8 failed to read large files

    i have got annoying issue, actually I have installed adobe reader8 recently.
    it reads small files(less than 2MB) without any problem. but when I try to open files of size more than 2 MB it get hanged including all other processes. then I do have to open task manager to terminate this.
    why there is so?

    I have a fairly new Windows Vista with Adobe 8. It will not open large eMails near the 5 MB range. I know they are mostly pictures , videos. I have on my desktop Adobe Reader 8, Adobe Media Player and adobe Photosh. I tried downloading adobe 9, but I don't see it on the desktop. What can I do to solve this? I am a retired Pharmacist. My computer knowledge is between Beginner and Intermediate.
    Thank YOu,
    [email protected]

  • Compressor won't compress large files from QT X Screen cap

    all of my large screen capture files give a "Quicktime error: -36" when I try to transcode them in Compressor. Small ones work fine. Trimming one large file into two smaller ones makes no difference; the second of the two still fails. Ideas please..?

    Need more info:
    What compression settings are you using?
    File size of original file?
    Hard drive space remaining?
    How much ram?
    How many cores?
    etc
    Pretty much every little detail.

  • Esx24 sampler won't read my files or aliases..

    the esx24 won't read audio alisases from my sampler instrument folder. it doesn't matter whether the original file is saved on my desktop or and external drive. tech support seems to think it's a logic configuraton problem. can anyone help?

    Look at your System Profiler
    Apple in upper left corner>System preferences>About this Mac>More Info>System Report>Hardware>Disc Burning
    is the DVD drive being recognized here?
    Also >>>>>Hardware>Serial-ATA
    is the drive being recognized ?

Maybe you are looking for