Inserting PDF file into Clob

Hi,
I tried inserting PDF file into a CLOB column , in the below example l_bfile is a bfile datatype.
and I'm inserting l_bfile to CLOB column.
l_bfile := bfilename('C:\test', 'test.pdf');
But It is throwing below error:
ORA-06550: line 9, column 42:
PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got FILE
ORA-06550: line 9, column 1:
PL/SQL: SQL Statement ignored
Please advise me on this.
thanks,
Jagu
Edited by: user11221603 on Oct 11, 2012 6:18 AM

Hi,
Check this thread: How to store PDF file in BLOB column without using indirect datastore
Regards.
Al

Similar Messages

  • Error while inserting .doc file into CLOB object in oracle

    hello everybody ,
    i am trying to insert .doc file into clob column in oracle database.i am using oracle 8i. But i am getting error saying
    ORA-01461: can bind a LONG value only for insert into a LONG column
    i have no clue.
    i am pasting code here
    please help me out.
    regards
    darshan
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileReader;
    import java.io.Reader;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    public class InsertingClob {
    public static void main(String[] args) {
    File f = new File("E:\\dar
    sowres.doc");
    int len = (int) f.length();
    System.out.println(len);
    Connection conn = null;
    PreparedStatement ps = null;
    try {
    FileReader fr = new FileReader(f);
    String FILE_INSERT_QUERY = "INSERT INTO RESUMED VALUES(?,?)";
    conn = JDBCUtility.getConnection();
    ps = conn.prepareStatement(FILE_INSERT_QUERY);
    ps.setString(1,"1");
    ps.setCharacterStream(2,fr,len);
    int result = ps.executeUpdate();
    if(result ==1) {
    System.out.println("file has been successfully inserted into the db");;
    }else {
    System.out.println("not inserted");
    }catch (Exception e) {
    e.printStackTrace();
    and the error is
    java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2152)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2035)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2876)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:609)
    at InsertBlob.main(InsertBlob.java:21)
    java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column

    You may have one of a few errors going for you there:
    The error says your column in Oracle is a Long not a CLOB, if it is, then make your column a CLOB.
    CLOB's are not suppored in all environments and/or all interfaces (specifically Windoz ODBC has a problem).
    I believe a DOC (Windoz MS-Word) file is a BLOB, due to formatting characters in the file.
    I had a very similar error using Access and trying to do this, but changing to SAS fixed the problem. It could very well be that your version of ODBC/JDBC drivers does not support it properly.

  • I want to insert .pdf files into a "Master" .pdf file at pre-determined intervals - how do I do this?

    I want to insert .pdf files into a "Master" .pdf file at pre-determined intervals - how do I do this?

    Hi markm11762689,
    When you insert pages, you can determine whether they go before or after the first or last page, or a page number that you specify.
    If you're inserting multiple files at once, they will all be inserted in the same spot that you specify in the Select File to Insert dialog box.
    There may be a way to handle this programmatically, and there are some very clever folks who visit these forums regularly. Let's see if they chime in...
    Best,
    Sara

  • Inserting pdf file into database

    I am trying to insert a adobe pdf file into a multimedia field in my database and while I can get it to cut and past I would like it to auto size into the box that I have defined for it. I have many records to compile, thousands. Some of these pdf files have several pages and it would be nice to be able to scroll through thier content in that multimedia field box. How do I do this? Is it possible? If not I assume I am stuck with making a link that opens the file. I assume this is possible. How do I do this?
    Thanks in Advance,
    Shane

    Hello
    You may enter the Layout > Layout mode to enlarge the area dedicated to the multimedia field.
    But there is no provision for an autosize feature.
    The link soluce is not available in databases.
    I mimic it true the "enhanced database" structure requiring an AppleScript.
    You may find the script on my temp iDisk or in the Peggy's one which is organised well.
    Peggy's idisk
    Yvan KOENIG (from FRANCE 20 octobre 2005 12:20:17)

  • Insert pdf file into another pdf file keeps getting stuck

    I am trying to insert a 5 page pdf file into another pdf file (both unsecured) and it keeps getting stuck at about 71%* conplete. I can't even get the file to show up on the screen so i can close it. Help?

    I have tried several different files, and get the same phenomenon with each one –
    1.     I open an acrobat file.
    2.     I open a WORD file.
    3.     I copy a sentence from WORD to the clipboard.
    4.     I click on View in Acrobat, Tools, Pages, other options, insert from clipboard.
    5.     Acrobat shows that it is copying, and when it gets to 67% it stops and runs and runs and then only way I can stop it is to go to the task manager and end task.
    I tried refrying with a file and that didn’t work, and I can’t imagine that Acrobat was designed so that each time I try to insert from WORD I would have to refry (even if it did work).
    Please help!
    Thank you
    Shirah
    Moadim LeSimcha, times of joy!

  • Inserting PDF files into iPhoto

    I am trying to insert separator pages for my slideshow using the article in MacWorld. All is fine til I get to the point where I need to insert the pdf into my slideshow. Below is the error I receive:
    Unreadable files: 1
    The following file could not be imported. (This file is in an unrecognized format.)
    Here is what I have done so far in regs to troubleshooting.
    Removed my iPhoto library from my shared directory to my original Pictures directory & did the batchmod that someone recommended elsewhere to make sure all my iPhoto files/dir have the correct permissions/owners.
    Deleted all references to adobe reader on my mac & reinstalled the latest & greatest (7.0.8)
    Recreated the pdf files (from the pics) after I reinstalled reader 7.0.8.
    Ran disk utils to make sure permissions were correct on my system.
    Where else do I look to see what the file formats are besides Get Info? Dh says I should resintall iPhoto, but the updates take forever even with a dsl (but then it could have something to do with my 1500 pics too
    Something is missing between Adobe & iPhoto or even OS X but I can not seem to figure it out.
    I am currently running OS X 10.3.9 (Panther), iLife 6-iPhoto version 6.0.5 (316)
    Thanks in advance for any & all help.
    Kitty
    Dual 1.3Ghz G4 1G RAM   Mac OS X (10.3.9)  

    Thanks, OT for getting back on this. I was hoping you'd respond I've been reading all the posts you've had on this subject & knew you were a resident expert.
    I had seen before that the pdf's could not be imported but I was hoping that iLife 6 now took care of that problem & according to the below linked article it appeared to.
    http://www.macworld.com/2006/12/secrets/jandigitalphoto/index.php
    Is the article incorrect that this version of iLife does not support it as the article seems to imply?
    In regs to your suggestion, I had already done exactly as you suggested sometime yesterday & the quality of the jpeg that was done as a 'save as' from preview was horrible.
    I am now in the midst of using iDVD to make my slide show. Unfortunately, the process is slower than iPhoto & I'm not remembering what I've already edited, sorted, etc etc since I've been working on this for at least 2 days now & am now doing it a 2nd time.
    I've read your posts about you saying you only use iDVD for SS & thought I'd try it. I am having a problem about the refresh rate on our video & the speed with which it is working on our mac but I don't know if that is due to the number of photos on iDVD, the fact that I am still on OS X 10.3.9 & iLife 6 is supposed to work better on Tiger, my learning curve since I've never used it or what.
    Anyways, I'll be up bright & early tomorrow working on it hoping I can get it complete & shipped out to famiy members late afternoon or evening.
    Take care & thanks,
    Kitty
    Dual 1.3Ghz G4 1G RAM   Mac OS X (10.3.9)  

  • Unable to insert pdf object into 64-bit Word 2010

    I have always been able to insert pdf files into word documents.  However, when I upgraded to the 64-bit version of Word, I started experiencing the below issue.
    My setup is: Windows 7 64-bit, Word 2010 64-bit, Adobe Acrobat 9 Pro v9.4.7.
    When I attempt to insert a pdf file into Word, I receive the following message:
    "The program used to create this object is AcroExch.  That program is either not installed on your computer or it is not responding.  To edit this object, install AcroExch or ensure that any dialog boxes in AcroExch are closed."
    I have researched this issue a great deal. 
    Previously, I found a posting which specified some registry keys to delete.  I followed these directions and it worked.  But, after installing some updates, the issue is back and I am unable to find the post specifying the registry keys to remove.
    Any help will be greatly appreciated.
    Thanks!
    Brandon

    Solution:
    Open Adobe Reader / Pro
    Go to Edit àPreferenceà General (LHS)àUncheck “Enable protected mode at startup”.
    Adobe Reader’s protected mode will be disabled
    Now try inserting Adobe document in Word, it will work.  

  • HT3529 How do I insert a pdf file into my message?

    How do I insert a pdf file into my message? please help!

    thank you James! I suspected that this could be the solution, but i am new to iPads and it is a pain to find a file on iPad in order to do this operation, in windows there is windows explorer and i cannot see anything like that on iPad.. any hints would be appreciated!

  • Unable to insert or drag and drop PDF file into PowerPoint 2010

    Hi all.  I am trying to drag and drop a PDF file into a power point file (PowerPoint 2010).  However, power point responded with the error "The server application, source file, or item can't be found, or returned an unknown error.  You
    may need to reinstall the server application".  I also tried to use the Insert feature "Insert --> Object --> Choose from file", yet also getting this same error message. This is what I've tried:
    a) I've tried to disabled the Adobe Protected Mode on Adobe Acrobat Reader 11, yet no luck. 
    b) Also tried on a machine got Adobe Reader 9 installed, still getting the same error message
    c) Tried to register the OLE library, no luck
    I haven't tried to re-install Office 2010.  It looks like this is a Office 2010 issue, have any one of you encountered this issue and is there a solution for it?  Drag and drop Excel and Word file into power point is working fine.  Thank you. 

    I would suggest you try a complete re-install and see if issue persists.
    I know I know, but you've already tried the Most Possible solutions (disable the protected mode/ register the OLE libray). It might worth trying a complete uninstall and re-install.
    http://www.pptfaq.com/FAQ00236_Can-t_edit_Org_Chart-_Graph-_Excel_-error_msg-_-server_application-_source_file-_or_item_can-t_be_found--.htm
    Aravindhan Battepati

  • Insert PDF into new Adobe Form - merging two PDF files into one

    Hi everyone,
    I need to enable access to archive PDF files but within a new PDF file containing header and footer.
    Request is not to change archived PDF files at all.
    I use Web Dynpro application to upload PDF file and to display new PDF file.
    I thought converting archive PDF files into JPG files and than using an 'Image Field' object to display those in a new PDF file.
    I am dealing here with PDF version 1.3 files.
    I am also having trouble converting these PDF files into JPG files. Any sugestions one this problem?
    Does anyone have any suggestion on how to deal with this concerning the fact that archive PDF files can not be changed?
    Is there some other way to merge two PDF files into one using Adobe Designer?
    Regards,
    Amel

    Hello, Lukasz:
      I am also facing similar requirement from my customer.
      And I found one useful blog, hope this blog can help you.
      http://wiki.sdn.sap.com/wiki/display/WDJava/CombinePDFfileswithWebDynproforJava
      Best regards, Nick.

  • Loading external (PDF)file into BLOB colum in the table.  Need urgent help.

    Hi All,
    I've currently been working on loading many external binary files (PDF) into BLOB column. After some digging, I learn that the SQL*LOADER can be used to load data from external files into table. I also got help from another forummate mentioning to use PL/SQL procedure to do so. Since I have not done anything like this before. So, my question is what is the simple approach needed to upload PDF files into a table(there is only one table containing BLOB column in my database). In addition, the LOBs can not be query-able, I wanted to list the contents of the LOBs column to make sure that I did successfully upload data into the database. How can I do that?. I do need your help. Please direct me step by step how to do so. Your help is greatly appreciated.
    Regards,
    Trang

    Once the PDF file is inserted in the PDM table, i am not able to read the PDF data from the below code, This code converts the binary data into the Character data i.e BLOB data into the CLOB, but still the data is not proper which is getting inserted PDF is proprietary format of Adobe. And you cant just read it from pl/sql. You need Adobe software installed in your client machine to view it.
    Here is an example of how to do it.
    [url http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:232814159006] Display PDF Stored in Database from ASKTOM 

  • Acrobat XI PRO: Create a Table of Contents (TOC) automatically in top, after I have combined several pdf.files into a single pdf.file

    Hey
    I have now tried for hours, but now I give up!
    MY WISH -
    Create a Table of Contents (TOC) automatically after I have combined several pdf.files into a single pdf.file.
    I have already bookmarks, shown on the screen (see screenshot below) but I want those bookmark to be visualised in a separate TOC in the top of the combined files.
    This new TOC (which I have inserted) shall be printable and serve as a cover page in a binder.
    I have seen other cheap pdf.programs in the market (e.g. PDF Converter Professional 7.3) which are able to make the above things, easy, fast and nice.
    Regards
    Ole Bünger, Kristianstad Sweden

    Somewhat roundabout way but this should work:
    Is there easy way to print bookmarks Acrobat Pro 9.5

  • How do I combine several PDF files into one?

    I have renewed Adobe subscription and would like to combie several PDF files into one. I was able to do this last year, but can no longer combine files. What am I doing wrong? Step-by-step answer, please. Thank you.
    Marilee

    As TSN has indicated we have no idea what program you are using, other than you posted in the Acrobat forum. In Acrobat you go to File > Create > Combine (varies with version of Acrobat). You can also open one and then use the pages>Insert to add the others.

  • How do i merge two pdf files into one

    How do i merge 2 pdf files into one.

    Open up the first pdf in Preview
    Then from Menu
    select from Edit Menu
    Select Insert (your choice of)
              Page from Scanner
              Page from File (select your PDF file)
              Blank Page
    You can then save as your first file or rename it

  • How to read/write .CSV file into CLOB column in a table of Oracle 10g

    I have a requirement which is nothing but a table has two column
    create table emp_data (empid number, report clob)
    Here REPORT column is CLOB data type which used to load the data from the .csv file.
    The requirement here is
    1) How to load data from .CSV file into CLOB column along with empid using DBMS_lob utility
    2) How to read report columns which should return all the columns present in the .CSV file (dynamically because every csv file may have different number of columns) along with the primariy key empid).
    eg: empid report_field1 report_field2
    1 x y
    Any help would be appreciated.

    If I understand you right, you want each row in your table to contain an emp_id and the complete text of a multi-record .csv file.
    It's not clear how you relate emp_id to the appropriate file to be read. Is the emp_id stored in the csv file?
    To read the file, you can use functions from [UTL_FILE|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#BABGGEDF] (as long as the file is in a directory accessible to the Oracle server):
    declare
        lt_report_clob CLOB;
        l_max_line_length integer := 1024;   -- set as high as the longest line in your file
        l_infile UTL_FILE.file_type;
        l_buffer varchar2(1024);
        l_emp_id report_table.emp_id%type := 123; -- not clear where emp_id comes from
        l_filename varchar2(200) := 'my_file_name.csv';   -- get this from somewhere
    begin
       -- open the file; we assume an Oracle directory has already been created
        l_infile := utl_file.fopen('CSV_DIRECTORY', l_filename, 'r', l_max_line_length);
        -- initialise the empty clob
        dbms_lob.createtemporary(lt_report_clob, TRUE, DBMS_LOB.session);
        loop
          begin
             utl_file.get_line(l_infile, l_buffer);
             dbms_lob.append(lt_report_clob, l_buffer);
          exception
             when no_data_found then
                 exit;
          end;
        end loop;
        insert into report_table (emp_id, report)
        values (l_emp_id, lt_report_clob);
        -- free the temporary lob
        dbms_lob.freetemporary(lt_report_clob);
       -- close the file
       UTL_FILE.fclose(l_infile);
    end;This simple line-by-line approach is easy to understand, and gives you an opportunity (if you want) to take each line in the file and transform it (for example, you could transform it into a nested table, or into XML). However it can be rather slow if there are many records in the csv file - the lob_append operation is not particularly efficient. I was able to improve the efficiency by caching the lines in a VARCHAR2 up to a maximum cache size, and only then appending to the LOB - see [three posts on my blog|http://preferisco.blogspot.com/search/label/lob].
    There is at least one other possibility:
    - you could use [DBMS_LOB.loadclobfromfile|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#i998978]. I've not tried this before myself, but I think the procedure is described [here in the 9i docs|http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96591/adl12bfl.htm#879711]. This is likely to be faster than UTL_FILE (because it is all happening in the underlying DBMS_LOB package, possibly in a native way).
    That's all for now. I haven't yet answered your question on how to report data back out of the CLOB. I would like to know how you associate employees with files; what happens if there is > 1 file per employee, etc.
    HTH
    Regards Nigel
    Edited by: nthomas on Mar 2, 2009 11:22 AM - don't forget to fclose the file...

Maybe you are looking for

  • Installation problem on Power PC G3, 450MHz OS 9.2 trying to install OS10.4

    When I try to install, I get the dialog box: Mac OSX cannot be installed on this computer. Please consult the documentation for the list of supported computers. From what I can tell, I should be able to install on this computer; it appears on the lis

  • IDOC  ORDERS01

    I am testing IDOC for IDOC type ORDERS01. When i send PO from one client 502 to another client 602 (vendor) then a Sales Order should automatically be created at receive side . How is it possible? PO IDOC is going from 502 to 602 but no Sales order c

  • Adding other languages in Marketing attributes

    Hi all, Im currently working with marketing attributes and would like to add different languages in the attribute. I guess that you add different languages in the description tab in transaction CRMM_ROUT_PROF_CHAR? But it doesnt seem to work on attri

  • System Status MSPT cannot set a user status

    When creating a user status for PM orders (transaction OIBS) we have a user status WOM (waiting on material). The user status profile is assigned to the PM order Object type. We want the user status WOM to be automatically set when the system status

  • Itunes says i am not online

    I cant update my ipod from version 1.1 becuase itunes keeps saying that i am not connected to the internet? (and yes, i am connected) any ideas?