2
votes

how i can insert blob file into apex collection table by dynamic action .

I tried that but the bellow error in image appeared how i can solve this issue, and i tried that by the below code but the NO_DATA_FOUND error Appeared ALSO .

  DECLARE 
  V_BLOB BLOB;
  BEGIN
  select  BLOB_CONTENT  
  into V_BLOB  
  from apex_application_temp_files  
  where name = :P13_FILE; 
  APEX_COLLECTION.ADD_MEMBER(
    p_collection_name => 'T_FILE',
    p_c001            => :P13_DESC,
    p_blob001         =>V_BLOB -- FNC_CLOB_TO_BLOB(:P13_FILE)
    );

    END;        

error

1
Hello, do you still need help with this? Why are you using a Dynamic Action? Have you looked at the plug-ins on apex.world to see if one could help? Here are two that might: 1) apex.world/ords/… 2) apex.world/ords/…Dan McGhan
Hi Dan , i use the dynamic action because i try upload file without submit page and upload multi file but each file has a specific type ,the user must choose file type like below (two item one file type and the second file browse ) 1-file type (costing file /technical file/tender file ) 2-file browsejaw
How does the value of the file type item affect the file browse item? Did you look at the plug-ins?Dan McGhan
sorry dan, In plugin the user can upload multi files I think , how I can know what the file type ,(costing sheet or technical sheet ....),the user should be choose a file type and upload filejaw
I think you're trying to say that the value of File Type will determine what types of files can be uploaded via File Browse, is that correct? If so, what types of files do "costing sheet" or "technical sheet" map to? Finally, have you tried the plug-ins to see if there are settings for multiple files or not?Dan McGhan

1 Answers

0
votes

My solution works for Files, I guess it will works for images too. There are two steps:

  1. Declare the item as 'File Browse' (Lets call it 'P1_FILE_BLOB).

    On item 'storage type' set it to 'Table APEX_APPLICATION_TEMP_FILES'). the file will now will be stored there...

  2. In your processes (When u click the 'Add' button), you need to pick that file from the 'APEX_APPLICATION_TEMP_FILES'.

     declare
     filename VARCHAR2(255);
     blob_content blob;
     mimetype VARCHAR2(255);
     begin
    
     select
        blob_content, filename, mime_type
        into blob_content, filename, mimetype
        from apex_application_temp_files
        where name = :P1_FILE_BLOB;
    
     apex_collection.add_member(
        p_collection_name => 'T_FILE',
        p_c001 => filename,
        p_c002 => mimetype,
        p_blob001 => blob_content
     ); 
     commit;
    
     end;
    

Of course you need to match 'p_c001'... to your own column in the collection table.