How to Upload a PDF file into BLOB column in a table using Forms 9i

Can anyone tell me how to upload a PDF file from client system using File dialog window and store its content in BLOB column in a table. The file to be uploaded will be in client side.

Hi,
please, search a bit on the forum before do a question:
Just searching by "upload blob pdf" ...
How to batch upload PDF files into database BLOB
Regards,
Jose.

Similar Messages

  • How to Upload a PDF file into BLOB column in a table using Forms 6i

    Can anyone tell me how to upload a PDF file from client and store its content in BLOB column in a table. The file will be genered using reports and win be stored in db.The file to be uploaded will be in client side.
    Thank´s.

    If you are using version 9 or 10 use webutil.... Look in webutil.pll.
    Use either one these two fuctions...
    FUNCTION Client_To_DB( clientFile       in VARCHAR2,
                             tableName        in VARCHAR2,
                             columnName       in VARCHAR2,
                             whereClause      in VARCHAR2,
                             asynchronous     in BOOLEAN default FALSE,
                             callbackTrigger  in VARCHAR2 default NULL) return BOOLEAN;
      FUNCTION Client_To_DB_With_Progress
                         (   clientFile       in VARCHAR2,
                             tableName        in VARCHAR2,
                             columnName       in VARCHAR2,
                             whereClause      in VARCHAR2,
                             progressTitle    in VARCHAR2,
                             progressSubTitle in VARCHAR2,
                             asynchronous     in BOOLEAN default FALSE,
                             callbackTrigger  in VARCHAR2 default NULL) return BOOLEAN;

  • To upload a PDF file in BLOB column using Oracle Forms 9i

    Can anyone tell me how to upload a PDF file from client system using File dialog window and store its content in BLOB column in a table. The file to be uploaded will be in client side.

    Take a look at the following :
    Re: Storing a PDF in a BLOB
    Re: Retrive Image from DB into Image_item
    although the threads above are reffered to images and word doc... the procedure/steps are the same....
    Greetings...
    Sim

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

  • 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 

  • Putting a .pdf file into a column in an oracle table

    I have created a table with one column as a blob so I can put 4800 .pdf files into that column of a table. Can anyone correct the ways I am trying to do this or let me know of a better way. I have tried several ways and have not been successful. Thanks.
    Here are the two ways I have tried that haven't worked.
    -- the storage table for the image file
    CREATE TABLE pdm (
    dname VARCHAR2(30), -- directory name
    sname VARCHAR2(30), -- subdirectory name
    fname VARCHAR2(30), -- file name
    iblob BLOB); -- image file
    -- create the procedure to load the file
    CREATE OR REPLACE PROCEDURE load_file (
    pdname VARCHAR2,
    psname VARCHAR2,
    pfname VARCHAR2) IS
    src_file BFILE;
    dst_file BLOB;
    lgh_file BINARY_INTEGER;
    BEGIN
    src_file := bfilename('O:\twilliams\DD_promotion\cards\', pfname);
    -- insert a NULL record to lock
    INSERT INTO pdm
    (dname, sname, fname, iblob)
    VALUES
    (pdname, psname, pfname, EMPTY_BLOB())
    RETURNING iblob INTO dst_file;
    -- lock record
    SELECT iblob
    INTO dst_file
    FROM pdm
    WHERE dname = pdname
    AND sname = psname
    AND fname = pfname
    FOR UPDATE;
    -- open the file
    dbms_lob.fileopen(src_file, dbms_lob.file_readonly);
    -- determine length
    lgh_file := dbms_lob.getlength(src_file);
    -- read the file
    dbms_lob.loadfromfile(dst_file, src_file, lgh_file);
    -- update the blob field
    UPDATE pdm
    SET iblob = dst_file
    WHERE dname = pdname
    AND sname = psname
    AND fname = pfname;
    -- close file
    dbms_lob.fileclose(src_file);
    END load_file;
    This one I get an error message on this statements:(dbms_lob.LOADBLOBFROMFILE(blob_loc,bfile_loc,dbms_l ob.lobmaxsize,bfile_offset,
    blob_offset) ; )
    DECLARE
    bfile_loc BFILE;
    blob_loc BLOB;
    bfile_offset NUMBER := 1;
    blob_offset NUMBER := 1;
    tot_len INTEGER;
    BEGIN
    /*-- First INSERT a row with an empty blob */
    INSERT INTO blob_tab VALUES (5, EMPTY_BLOB());
    COMMIT;
    /*-- SELECT the blob locator FOR UPDATE */
    SELECT blob_data INTO blob_loc FROM blob_tab
    WHERE id = 5 FOR UPDATE;
    /*- Obtain the BFILE locator */
    bfile_loc := bfilename('O:\twilliams\DD_promotion\cards\','00EAL.pdf');
    /*-- Open the input BFILE */
    dbms_lob.fileopen(bfile_loc, dbms_lob.file_readonly);
    /*-- Open the BLOB */
    dbms_lob.OPEN(blob_loc, dbms_lob.lob_readwrite);
    /*-- Populate the blob with the whole bfile data */
    dbms_lob.LOADBLOBFROMFILE(blob_loc,bfile_loc,dbms_l ob.lobmaxsize,bfile_offset,
    blob_offset) ;
    /*-- Obtain length of the populated BLOB */
    tot_len := DBMS_LOB.GETLENGTH(blob_loc);
    /*-- Close the BLOB */
    dbms_lob.close(blob_loc);
    /*-- Close the BFILE */
    dbms_lob.fileclose(bfile_loc);
    COMMIT;
    /*-- Display the length of the BLOB */
    DBMS_OUTPUT.PUT_LINE('The length of the BLOB after population is: '||
    TO_CHAR(tot_len));
    END ;
    /

    CREATE TABLE test_blob (
    id NUMBER(15)
    , file_name VARCHAR2(1000)
    , image BLOB
    , timestamp DATE
    CREATE OR REPLACE DIRECTORY
    EXAMPLE_LOB_DIR
    AS
    'O:\twilliams\DD_promotion\cards\'
    CREATE OR REPLACE PROCEDURE Load_BLOB_from_file_image
    AS
    dest_loc BLOB;
    src_loc BFILE := BFILENAME('EXAMPLE_LOB_DIR', '009-1395.pdf');
    BEGIN
    INSERT INTO test_blob (id, file_name, image, timestamp)
    VALUES (1001, '009-1395.pdf', empty_blob(), sysdate)
    RETURNING image INTO dest_loc;
    DBMS_LOB.OPEN(src_loc, DBMS_LOB.LOB_READONLY);
    DBMS_LOB.OPEN(dest_loc, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.LOADFROMFILE(
    dest_lob => dest_loc
    , src_lob => src_loc
    , amount => DBMS_LOB.getLength(src_loc));
    DBMS_LOB.CLOSE(dest_loc);
    DBMS_LOB.CLOSE(src_loc);
    COMMIT;
    END;
    I am getting this error when I exec load_blob_from_file_image.
    ERROR at line 1:
    ORA-00972: identifier is too long
    ORA-06512: at "SYS.DBMS_LOB", line 716
    ORA-06512: at "DRAWING.LOADBLOBFROMFILEIMAGE", line 15
    ORA-06512: at line 1
    any ideas why?

  • How can I upload a pdf file into the application server?

    Hi,
    I have the otf data, which i have converted into pdf using the funcation module "Convert_otf". Is it possible to upload the pdf file in application server?

    Dear Srishti,
    Use OPEN DATASET in BINARY MODE.
    following link will help you.
    http://scn.sap.com/thread/1480434
    thanks,
    vidyasagar

  • How do yo turn a pdf file into reader so i can edit the form?

    how do yo turn a pdf file into reader so i can edit the form?

    I have no idea what you are trying to say; your are trying to open a PDF with Reader?

  • How to convert a PDF file into a full editable WORD file?

    Hi,
    I tried to convert a pdf file into word but it is not fully editable. I can edit the title from the main page and that's it. The rest of the word document is saved as image. I tried editing teh pdf file but that one is not working either.
    Please help on how to convert a PDF file into a full editable WORD file.
    Thank you

    Not all PDF files are created equal.  When a PDF file is created with Adobe Tools it is usually "tagged" with information about the fonts the images, the layout etc...    This way when the PDF is saved to a new format like PPT or DOC then the results are usually usable.  However, if you have a PDF file that was not tagged for some reason then run the Accessibility tools on the PDF to acquire some basic tagging.  This may get you a better result.  Also if you have a PDF that is an image, then you may want to run OCR on it.

  • How to upload a PDF file in iCloud

    Hi everybody,
    I would like to know how to upload a PDF file in iCloud. I want to share some PDF files with my iPhone, MacBook and iMac.
    Thank you a lot!

    Yes, but the problem is will iBooks remember where I left off in that pdf file? Unlikely since it was deleted.  Also, what is handy about the kindle app is once you delete it an icon appears in the app to show that this file is in the cloud. I guess for reading pdfs the kindle app is better.  I am not saying that the kindle app would be that great for other things but at least with syncing and such it's much better.  Well, iCloud is meant for other things.  It's fine because I'll just use it for those other things and stick to the kindle app for reading pdfs.  Well I use endnote for reading technical pdfs, I'm just talking about novels and such on the kindle app. 

  • How to upload a Flat file into sap database if the file is in Appl'n Server

    Hello Sap Experts , Can you tel me
    " How to upload a Flat file into sap database if the file is in Application Server.
    what is Path for that ?
    Plz Tel Me its Urgent
    Thanks for all

    Hi,
    ABAP code for uploading a TAB delimited file into an internal table. See code below for structures.
    *& Report  ZUPLOADTAB                                                  *
    *& Example of Uploading tab delimited file                             *
    REPORT  zuploadtab                    .
    PARAMETERS: p_infile  LIKE rlgrap-filename
                            OBLIGATORY DEFAULT  '/usr/sap/'..
    DATA: ld_file LIKE rlgrap-filename.
    *Internal tabe to store upload data
    TYPES: BEGIN OF t_record,
        name1 like pa0002-VORNA,
        name2 like pa0002-name2,
        age   type i,
        END OF t_record.
    DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
          wa_record TYPE t_record.
    *Text version of data table
    TYPES: begin of t_uploadtxt,
      name1(10) type c,
      name2(15) type c,
      age(5)  type c,
    end of t_uploadtxt.
    DATA: wa_uploadtxt TYPE t_uploadtxt.
    *String value to data in initially.
    DATA: wa_string(255) type c.
    constants: con_tab TYPE x VALUE '09'.
    *If you have Unicode check active in program attributes then you will
    *need to declare constants as follows:
    *class cl_abap_char_utilities definition load.
    *constants:
    *    con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
    *START-OF-SELECTION
    START-OF-SELECTION.
    ld_file = p_infile.
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    ELSE.
      DO.
        CLEAR: wa_string, wa_uploadtxt.
        READ DATASET ld_file INTO wa_string.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
                                          wa_uploadtxt-name2
                                          wa_uploadtxt-age.
          MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
          APPEND wa_upload TO it_record.
        ENDIF.
      ENDDO.
      CLOSE DATASET ld_file.
    ENDIF.
    *END-OF-SELECTION
    END-OF-SELECTION.
    *!! Text data is now contained within the internal table IT_RECORD
    * Display report data for illustration purposes
      loop at it_record into wa_record.
        write:/     sy-vline,
               (10) wa_record-name1, sy-vline,
               (10) wa_record-name2, sy-vline,
               (10) wa_record-age, sy-vline.
      endloop.

  • How do I convert à PDF file into my dairy?

    How do I convert à PDF file into my dairy?

    If I understand whatnyounare asking (and not sure I do), you may have a difficult time accomplishing that. Calendar app doesn't store documents and I don 't know of an app that will extract text from a PDF and place it in a calendar entry automatically. Check the app store - I could be wrong - but you will have to handle that manually.
    Many apps that read PDF will allow you to copy text, including GoodReader mentioned above.

  • How to upload 20MB of file into MySQL through Java

    Hi Friends
    Anyone let me know how to upload 20MB of file into MySQL through Java programming, is there is any feature available, or any changes to be made in MySQL
    Thanks
    Sella

    Don't know. Ask the MySQL folks. This is not a Java issue.

  • How to break the PDF file into images?

    How to break the PDF file into images? There should be settings in Photoshop CS 6 that imports PDF file and break it into images.  I have a short instruction:
    2.    Open the file in Photoshop.
    3.    A new window should open to Import PDF.  Click on images, not pages  import pdf into Photoshop.doc
    4.    Select all the files shown (shift + click), Click O.K.  Four files should open on your screen.
      Was anybody successful with that?

    Whether this is available solely depends on the structure of the PDF and whether it actually contains whole images that can be extracted separately. Depending on whatgoing on in the PDF this may simply not be the case and the images have been tiled and split up in multiple "objects" whose appearance can only be retained by rasrerizing the whole page...
    Mylenium

  • How to show the pdf file into the UIWebView from iphone documents directory?

    Hi ,
         I am working on web services right now I am getting string into base64 format. After decoding that string into NSData i am saving that data as a pdf into Document directory of iphone. Now the problem is that when I want to show the pdf into UIwebView then it is showing blank page. But when I am checking into /Users/pareshkarnawat/Library/Application Support/iPhone Simulator/4.3.2/Applications/ the pdf file is correctly generated and working fine when I ope it.
       How to show that pdf file into UIwebview ? or is there any alernative for this.
    Any ideas on how I can go about this? I have looked at a few posts and still can't seem to figure it out.
    Any idea's appreciated, thanks

    The result is a UIWebView that displays a blank page. No errors occur in the UIWebView delegate method. The thing is that data has the correct length, in bytes, for the PDF I am trying to display, and I also get the pdf file in Library/Application Support/iPhone Simulator/4.3.2/Applications/ Does anyone have an idea as to what might be going wrong here or how I can better debug this problem?

Maybe you are looking for