P
P
Pavel Mikhalovsky2018-06-20 16:48:22
Oracle
Pavel Mikhalovsky, 2018-06-20 16:48:22

Why does an ORA-01403 error pop up when trying to load data into a table via APEX_APPLICATION_TEMP_FILES?

I'm trying to load data by pressing a button and calling DYNAMIC_ACTION. The For loop doesn't output anything. I save in APEX_APPLICATION_TEMP_FILES. I work in the online version at apex.oracle.com

declare  
  doc_size integer;  
  Upload_blob blob;
  commentWord EXCEPTION;
  cur NUMBER;
begin
    APEX_DEBUG.ENABLE(
        apex_debug.c_log_level_info);
    apex_debug.message('La-La-La');
    IF IS_NUMBER(v('COMMENTBOX')) = 0 THEN
        apex_debug.message('COMMENT IS 0');
        for r in (select * from apex_application_temp_files)
            loop
                apex_debug.message('name: %s - filename: %s', r.name, r.filename);
            end loop;
        --Copy BLOB to Upload_blob variable
        select blob_content
        into   Upload_blob
        from   APEX_APPLICATION_TEMP_FILES
        where  name = :FILELOAD;
        for r in (select * from apex_application_temp_files)
            loop
                apex_debug.message('name: %s - filename: %s', r.name, r.filename);
            end loop;
        --Get BLOB size
        doc_size := dbms_lob.getlength(Upload_blob);
        --Copy data to table MyIMAGES_TBL
        INSERT INTO MYIMAGES_TBL (
            IMAGE_NAME, FILENAME,
            MIME_TYPE, DOC_SIZE,
            CONTENT )
        select filename, filename,
                mime_type, doc_size,
                blob_content
        from   APEX_APPLICATION_TEMP_FILES
        where  name = :FILELOAD;
        SELECT MYIMAGES_TBL_SEQ.CURRVAL INTO cur FROM SYS.DUAL;
        apex_debug.message('cur: %d',cur);
        INSERT INTO ACTIONS(ACTION, FIO, COM, PERFORMER, FILM, IMAGE, TIMES) 
        VALUES ( v('VALUESLIST'),
                 v('FIOBOX'), 
                 v('COMMENTBOX'), 
                 v('APP_USER'),
                 v('DEPENDECESLIST'),
                 cur,
                 CURRENT_DATE
               );
    ELSE
        :HIDDEN:= 'NO';
        RAISE commentWord;
    END IF;
    EXCEPTION
        WHEN commentWord THEN
        :COMMENTBOX:= '';
END;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question