ORA-06502 error writing to PDF file

Oracle 10.1.2.0.8

I'm trying to create a procedure from pl/sql that will dump a bunch of pdf files stored in BLOBs on disk. It runs on a windows machine. In order to avoid line breaks, I use htp.prn.

When I run the following procedure, I get the error:

ORA-06502: PL/SQL: digital or value error: character string buffer too small

If I comment on htp.prn (utl_raw.cast_to_varchar2 (l_buffer)); then the error disappears.

I tried to use smaller buffers sizes but I still get the same error.

Any thoughts are appreciated.


PROCEDURE EXPORT_APNDX_FILES
IS
lv_code NUMBER; -used for the treatment of exceptions
lv_errm VARCHAR2 (64); -used for the treatment of exceptions
lv_err1 VARCHAR2 (120); -used for the treatment of exceptions
lv_err2 VARCHAR2 (120); -used for the treatment of exceptions

l_file UTL_FILE. TYPE_DE_FICHIER;
l_buffer RAW (32767).
l_amount directory: = 32767;
l_pos INTEGER: = 1;
l_blob BLOB;
l_blob_len INTEGER.

BEGIN
-Get LOB locator
SELECT studyapndx_fileobj
IN l_blob
Of er_studyapndx
WHERE rownum = 1; -<-first file is a pdf file

l_blob_len: = DBMS_LOB.getlength (l_blob);

-Open the destination file.
l_file: = UTL_FILE.fopen ("BLOBS", "file.PDF ', 'w', l_amount");

HTP.init;
owa_util.mime_header (' application/pdf');

-Pieces of the BLOB to read and write to the file
-full up.
While l_pos < l_blob_len LOOP
DBMS_LOB. Read (l_blob, l_amount, l_pos, l_buffer);
HTP. PRN (utl_raw.cast_to_varchar2 (l_buffer)); -<-mistake here
l_pos: = l_pos + l_amount;
END LOOP;

-Closes the file.
UTL_FILE.fclose (l_file);

EXCEPTION
WHILE OTHERS THEN
-Close the file if something goes wrong.
IF UTL_FILE.is_open (l_file) THEN
UTL_FILE.fclose (l_file);
END IF;

lv_code: = SQLCODE;
lv_err1: = SUBSTR (SQLERRM, 1, 120);
lv_err2: = SUBSTR (SQLERRM, 121, 240);
DBMS_OUTPUT. Put_line ('Error Code' | lv_code |) ': ' || lv_err1);
DBMS_OUTPUT. Put_line ('Error Code' | lv_code |) ': ' || lv_err2);

END; -Procedure

Change the file mode of text ('w') in binary ("wb") might be enough to allow the put_raw procedure work properly without incorporation of unintentional line breaks. Mode text on a windows machine, file IO routines know that the lines of the text file are completed by a CRLF combination, and it automatically adds the LF when missing essentially converted what he considers an end to end of line CRLF windows line CR style unix style. Binary mode should not do as it possible now that a CR character is not necessarily a line break.

Tags: Database

Similar Questions

  • ORA-29285: error writing file

    Hi, I'm trying to clear a table in a flat file, & provided the stored procedure using my Tom Kyte @ https://asktom.oracle.com/pls/asktom/f?p=100:11:0:NO:P11_QUESTION_ID:88212348059.

    It worked well at first, but now I always get the following error message:

    ERROR on line 1:

    ORA-29285: error writing file

    ORA-06512: at "OFSA_ATOMIC. DUMP_TAB_TO_CSV", line 45

    ORA-06512: at line 1

    The search for this error ORA out Virgin on MOS.

    Any ideas how to solve this problem?

    I already checked for space on the file system and there is lots of space available.

    Also, the file is created with a size of 0 bytes before the procedure was abandoned.

    Thank you

    -CV

    Hello

    trying to figure out what has changed since it worked. Length of the line would be greater than 1024 default that uses Tom proc?

    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e40758/u_file.htm#ARPLS70900

    The FOPEN max_linesize parameter must be a number in the range 1 to 32 767. If not specified, Oracle provides a default value of 1024.

  • Error message - error 1310: error writing to the file: C:\Config.Msi\95cd7a.rbf

    I get the error message on the software updates: error 1310: error writing to the file: C:\Config.Msi\95cd7a.rbf.  Make sure you have access to this directory.  How can I fix it?  Thank you

    Hello

    ·          What version of the operating system is running on your computer?

    ·          What software you are trying to update?

    However, try the following steps:

    Unregister and re-register Windows Installer.

    a. Click Start and then click Run.

    (b) in the Open box, type msiexec /unreg and then press ENTER.

    c. Click Start and then click Run.

    (d) in the Open box, type msiexec/regserver, and then press ENTER.

  • How can I fix excerpt: error writing to the file and an unstable WiFi connection

    original title: How can I fix excerpt: error writing to the file

    Hello, I do not know anythingon fixing of my computer when I have problems. I looked at all the research sites and assistance, and none of them helped me with these problems and im getting ready to launch her aspire one mini laptop computer. im running xp and I bought it used and it has done this from day one. 2 weeks ago, that I got it. Please can you help me.

    How can I fix excerpt: error writing to the file C:docume~1\user\local~1\temp\nsvc.tmp\conduit-left.bmp

    and im having problems with my connection remaining on the port wireless what do I do, I can solve this problem too because I cannot even be in line for more then 5 minutes with the duty to stop and start over or repair the connection.

    For the first question, try to go to start | Programs | Accessories | System Tools | Disk Cleanup and that should clear of junk.  Then click Start | Run and type msconfig and disable the startup items, that you don't need, as many programs decide that they must run at startup and clutter the machine when they do not need to.  Also perform a defragmentation of the disk (under system tools also).  See if that helps with performance and other issues.

    Steve

  • "Error 1310" error writing to the file: c:\config.msi\f2046.rbf "while trying to install Adobe.

    Atitle: how to fix error 1310?

    We have vista and I get this error when I try to download adobe reader: 1310.error error writing to the file: c:\config.msi\f2046.rbf. How can I fix this error? Also had trouble to update old adobe, so I uninstalled, so now I have no adobe reader.

    Hello

    -Is the issue limited only when trying to install Adobe programs?
    -Did you do changes on the computer before this problem?
     
    Method 1: Run the FIXIT from Microsoft from the link below and check if the problem persists.
    Solve problems with programs that cannot be installed or uninstalled
     
    Method 2: I also suggest you to see the link below and check if that helps.
    Update errors. Acrobat, Reader | Windows
     
    Hope this information helps.
  • Error writing to the file C:/Config.msi/93320.rbf (download iTunes 10.7)

    Error writing to the file C:/Config.msi/93320.rbf, make sure you have access to this directory.

    I am trying to download iTunes 10.7 but I see this error. How can I fix it?

    Hello

    Try to uninstall and reinstall the ITunes and check:

    Step 1: Uninstall the program

    Check out the link:

    Uninstall or change a program

    http://windows.microsoft.com/en-us/windows7/Uninstall-or-change-a-program.

    Step 2: Install the program

    Get the latest version of the program and install it and check if the problem persists.

    Check out the link:

    http://www.apple.com/asia/itunes/download/.

    Question still remains the same contact Apple Support.

    I hope that the above information is useful!

  • Error 1310. Error writing to the file. C:\ProgramFiles\Adobe\AcrobatDC\Acrobat\LogTransport2.exe. Make sure you have access to this directory.

    I led by d/Acrobat DC, and when I tried to install it, I got the following error message. "

    Error 1310. Error writing to the file. C:\ProgramFiles\Adobe\AcrobatDC\Acrobat\LogTransport2.exe. Make sure you have access to this directory. »

    Did anyone here know how to fix this?

    Thank you

    Charlie

    Hello

    You might see the following links for more information and troubleshooting error 1310.

    Error "1310: error writing to the file: C:Config.Msi...» » | CS4 products

    Concerning

    Sukrit diallo

  • 1310.error error writing to the file for CS2 install Win7 for Adobe Pro 7

    I have Adobe 7 Pro to be installed on a machine Win7 which is not supported by Adobe.  They provide a CS2 version with a new serial number for replacement of my product since my product cannot be activated anymore.

    When I try to install it, I get the following error after started the installation process.

    1310.error error writing to the file: C:\Program Files (x 86) \Adobe\Acrobat 7.0\Active X\AcroPDF.DEU.  Make sure you have access to this directory.

    I am the admin of my machine and I also tried to install their version as the admin as well.

    Any help to get through this?

    I wasn't able take the permissions of the folder Active X using one of the recommendations no matter how I tried to change the permissions.  Activa X file for some reason any was locking me even if I am the admin.  There were four files that were already saved in the folder as part of the installation process that was able to complete before my error popped up.

    A work around that worked for me is that I have renamed this file active X_old - I have at least managed to rename the folder, even if I was not able to change its permissions.  I created a new Active X folder and copied the four files in the original in the new.  I've then restarted the installation process, and it went through.  It seems that I have all the features of the Adobe 7 Pro.

  • IO error writing block to file

    Hello

    Try to create a big clue, I got:

    ERROR on line 1:

    ORA-01114: IO error writing block to the file 2003 (block # 3506172)

    ORA-27085: Message not found; 27085  product = RDBMS. facility = ORA

    Additional information: 16384

    Additional information: 32768

    ORA-01114: IO error writing block to the file 2003 (block # 3506172)

    ORA-27085: Message not found; 27085  product = RDBMS. facility = ORA

    Additional information: 16384

    Additional information: 32768


    something strange is that I have no file 2003, how is that possible?


    Thank you

    Oracle 11.2.0.4


    If DB_FILES is set to 2000 in your database, file id 2001 is the first TEMPFILE.  file 2003 is the third TEMPFILE.

    Hemant K Collette

  • Error writing to the file C:/Program Files/Quick Time/QTTask.exe when tried to install QuickTime

    Original title: install Quick Time and I Tunes

    Recently, I uninstalled ITunes and Quick Time. I cannot install Quick Time now. It says: "Error writing to file C:/Program Files/Quick Time/QTTask.exe. Make sure you have access to this directory. »

    I got the exact same error today by updating to Itunes.  I found the cause of my problem.  I had a firewall is installed and configured to block the QTTask.exe to talk to his server.  The firewall to put the file in a list of quarantine and blocked all access to the file.

    The Itunes update went through after that I removed it from the list of firewall quarantine.

  • Error CANT DOWNLOAD PDF FILES/module

    When I download a file to microsoft office I get a window with options of download, IE: the West, Japanese etc. & I get an error message from module vz. I can't download files I tried everything! Can simeone if you PLEASE HELP me!

    Green blessings to you & yours,

    Ellen

    Hi Ellen,.

    What program exactly do you use to do the download (name and version) - I'm not familiar with any Office program that performs downloads - although you can get attachments via Outlook (Internet Explorer and if so which version)?  In the place where (what exact path name) do you download (desktop, downloads,...)?  This ONLY happens on the PDFs - I mean can you download other types of files such as .doc or .xml or other (or if you have not tried)?  What is the EXACT message text receive you (especially the vz module error message but all other messages as well) and when to do each process occur?  What version of Vista are you using (for example, 32-bit Vista Business SP2) and you have installed language packs?  When exactly the problem started?  What version of Microsoft office are you using?  Do you have Adobe Reader installed (or some other ptrogram which can open and read PDF files (if so, what name and version)?)

    Let's start with a fairly simple option that can solve the problem.  Do you know when this problem started?  Try a system restore to a point in time before the problem started (give him room to manoeuvre a little if you can).  Here is the procedure: http://www.howtogeek.com/howto/windows-vista/using-windows-vista-system-restore/.  Don't forget to check the box to show more than 5 days of restore points.  If the first attempt fails, then try an earlier point or two.  NOTE: You will need to re - install any software and updates that you have installed between now and the restore point, but you can use Windows Update for updates.

    For additional help (if the system restore does not resolve the problem), I need answers to the questions in paragraph 1.  Sorry, but we need your help with this information to help you.

    Thanks and good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • ORA-06502 error digital or value of PL/SQL.

    Hi experts,

    Oracle Apex 4.2, 11g database, using windows 7.

    I created a form and trying to create automatically generated # (sequence of not) with logic and SQL.

    My requirement is to generate the good good exercise only and exercise begin from 01 July and ends 30 June each year. This means if the 07/01/2015 start it will create a new voucher No.

    The table name is GL_PV and the columns are:

    Number of PV_No

    Date of PV_Date

    Number of CC_code

    number amount

    Remarks varchar2 (100)

    What I did: -.

    Created a process to submit before the calculations and validations.

    Code are

    IF TO_NUMBER (TO_CHAR (: P15_pv_date, 'MM')) < = 6 THEN

    SELECT MAX (to_number (nvl(pv_no,0))) + 1

    IN: P15_pv_no

    OF GL_PV

    WHERE pv_date

    BETWEEN

    TO_DATE ('01 - JUL' |) ' -'|| (TO_NUMBER (TO_CHAR(:P15_pv_date,'YYYY'))-1), 'DD-MON-YY')

    AND

    TO_DATE (30 - JUN'|) ' -'|| To_char(:P15_pv_date,'YYYY'), 'DD-mon-YY')

    and cc_code =: P15_cc_code;

    ON THE OTHER

    SELECT MAX (to_number (nvl(pv_no,0))) + 1

    IN: P15_pv_no

    OF GL_PV

    WHERE pv_date

    BETWEEN

    TO_DATE ('01 - JUL' |) ' -'|| To_char(:P15_pv_date,'YYYY'), 'DD-mon-YY')

    AND

    TO_DATE (30 - JUN'|) ' -'|| (TO_NUMBER (TO_CHAR(:P15_pv_date,'YYYY')) + 1), 'DD-MON-YY')

    and cc_code =: P15_cc_code;

    END IF;

    If: P15_pv_no is null then

    : P15_pv_no: = 1;

    end if;

    and press the button when Conditions = Generate_Button

    I have the default assign to pv_date = sysdate, when I launched the point Pv_date form shows the current date and I click on Generate_button now show error.

    Error ORA-06502 PL/SQL digital or value. Conversation number character.

    One last thing, I checked this code already in TOAD, type I assigned as DATE-value = 10/11/2014 (today's date) works fine without error.

    Please guide what this evil is stated.

    Best regards

    : P15_pv_date is probably not a date but a varchar2 in Apex

    Try this

    NVL SELECT (MAX (to_number (nvl(pv_no,0))) + 1, 1)

    IN: P15_pv_no

    OF GL_PV

    WHERE pv_date

    BETWEEN to_date (' 01-07-' |) (extract (year of to_date (: P15_pv_date, "dd-mm-yyyy")) + case when extracted (months to_date (: P15_pv_date, "dd-mm-yyyy")))<= 6="" then="" -1="" else="" 0="" end="" ),="" 'dd-mm-yyyy'="">

    AND to_date (30 - 06-' |) (extract (year of to_date (: P15_pv_date, "dd-mm-yyyy")) + case when extracted (months to_date (: P15_pv_date, "dd-mm-yyyy")))<= 6="" then="" 0="" else="" 1="" end="" ),="" 'dd-mm-yyyy'="">

    and cc_code =: P15_cc_code;

  • How can I see errors in a PDF file

    Hi, I use coldfusion cfdf to create a PDF file for a Web site application, but when I open the PDF file on a mac in Adobe Acrobat Pro ms, I get the alert...

    There is an error on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem.

    So I can they and correct the error, is there a way I can view the errors on the page?

    Acrobat has no tools that will help you. This requires a detailed examination by an expert. If you can post a sample publicly, an expert has sometimes at times to lose to an interesting problem. You must also make sure that all of your ColdFusion components are perfectly up-to-date.

  • Post installation problems, ORA-00205: error in control identiying files

    Dear all,

    On a new installation on Oracle Enterprise Linux 5.3 64-bit, I installed Oracle 11 g 1 64-Bit material. There was not a single error during installation. But DB has not been started.

    When I tried to start the DB, it gives the following error:

    ORA-00205: error in the identification of control files.

    I edited the init.ora file:

    control_files = (/ opt/app/oracle/oradata/bsserp/control01.ctl, opt/app/oracle/oradata/bsserp/control02.ctl, opt/app/oracle/oradata/bsserp/control03.ctl)

    But the error remains the same. I even recreated the PB but his will not change.

    Kindly help on that.

    Best regards, Imran

    misterimran wrote:
    It seems that the compatible thing worked, but now the error changed to:

    ORA-01103: name of the database "BSSERP" in the control file is not "DEFAULT".

    Can I modify the control file to change the database name. Because the database is not in a State of mounting I can't question the name of database to help:

    SELECT database name $ v the folder name is BSSERP.

    You need to replace BSSERP DB_NAME parameter (but actually it's DEFAULT), and then restart the database.

  • unknown error in opening pdf files attached

    Vista operating system; Adobe Reader is selected to use to open the pdf files, but is not used in Thunderbird. If saved to the desktop, the files normally.

    How to load Thunderbird to use Adobe Reader to open .pdf files.

    Right-click on the attachment and choose 'open '.
    a new window opens
    Choose 'Open with' and select 'Adobe Reader' from the drop-down list drop-down list.
    Select this option to ' automatically for files like this in the future "
    Click OK

    It will now be shown here:
    Tools > Options > Annexes > Incoming tab
    or
    3 menu bar icon > Options > Options > spare parts > Incoming tab

    in Content Type, it will display ' document to adobe acrobat (.pdf)
    and to the right, it should show the 'Action' to use the adobe reader software.

    If you want Thunderbird always ask where to save the files, you can select this option or choose where to save files, and use the Browse button to search for a folder.
    Click OK

Maybe you are looking for

  • Can I change my username without having to create a new profile?

    HI, I just bought my mac and the installation of my user profile, just how I like it but I just want to change my username. Is this possible? Sorry if its very simple but I'm kinda new to this.

  • Automate «Clear history...» "in Safari 9?

    I tried to find a way so whenever I left Safari, all cookies are erased, cache, deleted, etc. I can't find an Extension, nor have workflows from AppleScript scripts and Automator has worked for me. Here's what I put in an Automator-> run the AppleScr

  • iMovie rough

    Made a movie with iMovie 10.1. Played fine on iMac. Copied onto the discs and now playback is jerky even with the iMac and PC. I'm on a timeline for the project is completed, any suggestions? All software up to date, running OS X El Capitan version 1

  • Purchase of additional iCloud storage request

    Hello I just wanted to know... If I had to start paying for and using storage additional iCloud beyond the limit of 5 GB free, what happens to the content that save to iCloud if I then stop paying for free storage extra iCloud beyond the 5 GB limit?

  • Compaq Presario CQ61 problem

    Good day to all, I have a problem with my compaq presario cq61. My unit does not start with the battery or even the power supply is connected. > I don't know that my diet is in good condition. The LED is on and it's output voltage. > I noticed someth