10 Replies Latest reply on Apr 29, 2016 9:53 AM by Kalpataru

    Unable to attach document in database Via Oracle Forms 11gR2?

    Su.gi

      Hi All, 

               I am developing an application using Oracle Forms and Reports 11gR2.

      I have a table like below

       

      CREATE TABLE EMPLOYEE_ATTACH

      (  EA_SEQ_NO     NUMBER(5),  

      EA_DOC_NAME   VARCHAR2(50 BYTE), 

      EA_DOC        BLOB )

       

       

      I used the above table in forms and have a one button.

      In WHEN-BUTTON-PRESSED trigger, I used the below code

       

      DECLARE

         VAR_FILE_NAME        VARCHAR2 (500);

         VAR_FILE_NAME_ONLY   VARCHAR2 (100);

         GLO_BU               VARCHAR2 (500);

         LB$RESULT            BOOLEAN;

      BEGIN

       

      VAR_FILE_NAME := client_get_file_name ('','','jpeg Files/*.jpg','Select an Doc File', open_file,TRUE);

       

       

         IF SUBSTR (VAR_FILE_NAME, 1, 1) = '\'

         THEN

            VAR_FILE_NAME := '\' || VAR_FILE_NAME;

         END IF;

       

       

         VAR_FILE_NAME_ONLY :=

            SUBSTR (VAR_FILE_NAME,

                    INSTR (VAR_FILE_NAME, '\', -1) + 1,

                    LENGTH (VAR_FILE_NAME));

         :EA_DOC_NAME := VAR_FILE_NAME_ONLY;

         COMMIT;

         GLO_BU := 'EA_SEQ_NO = ''' || :EA_SEQ_NO || '''';

         LB$RESULT :=

            WEBUTIL_FILE_TRANSFER.CLIENT_TO_DB_WITH_PROGRESS (

               VAR_FILE_NAME,

               'EMPLOYEE_ATTACH',

               'EA_DOC',

               GLO_BU,

               'File Upload',

               'FILE UPLOAD IN PROGRESS..',

               FALSE,

               NULL);

      END;

       

       

      For me, If I choose the file for attach, then the progress bar is loading, but it is not stored in my database.

       

       

      How to solve this problem??

       

       

      Thanks in Advance,

      Su.gi