Oracle Datapump API - APPEND - oracle

The following tries to APPEND data to the CLASS table from a dmp that contains several hundred records for that table. There is 1 record already in database and that record also exists in the .dmp. The job completes but no data is appended.
If i switch the parameter to TRUNCATE, the single value is removed and replacedw ith the content of the .dmp i.e .works correctly.
Can anyone tell me what's wrong with this proc that's causing APPEND to fail?
The documentation doesn't seem to offer much beyond a reference to metadata (https://docs.oracle.com/database/121/ARPLS/d_datpmp.htm#ARPLS66059)... i have tried removing the metadata filter included in the code below, but with no +ve result.
Thanks
create or replace procedure import_backup (in_file_name in varchar2,
in_job_name in varchar2,
in_export_filename in varchar2)
is
l_dp_handle number;
l_status varchar2(200); -- Data Pump Status
l_file_name varchar2(100) := nvl(in_file_name,'IMPORTBACKUP');
l_job_name varchar2(100) := nvl(in_job_name,'IMPORTBACKUP20');
l_ipaddress VARCHAR2(20);
l_time VARCHAR2(20);
PROCEDURE_NAME VARCHAR2(30) := 'export_backup';
begin
select PARAM_VALUE
into l_ipaddress
from PARAMETER
where PARAM_NAME = 'DATABASE_SERVER';
select to_char(sysdate, 'YYYYMMDDHHMISS')
into l_time
from dual;
--Log_Message(PROCEDURE_NAME,'Starting with in_file_name: ' || l_file_name || ' and in_job_name: ' || l_job_name);
-- Open a table export job.
l_dp_handle := dbms_datapump.open(operation => 'IMPORT',
job_mode => 'TABLE',
remote_link => NULL,
job_name => l_job_name,
version => 'LATEST');
-- Specify the dump file name and directory object name.
dbms_datapump.add_file(handle => l_dp_handle,
filename => in_export_filename,
directory => 'EXPORT_DIR');
--Specify Truncate mode (to remove table contents and replace with file's contents
DBMS_DATAPUMP.SET_PARAMETER (
handle => l_dp_handle,
name => 'TABLE_EXISTS_ACTION',
value => 'APPEND' );
-- Specify the log file name and directory object name.
dbms_datapump.add_file(
handle => l_dp_handle,
filename => in_export_filename || l_time ||'expdp_XYZ.log',
directory => 'EXPORT_DIR',
filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
-- Specify the table to be imported, filtering the schema and table.
dbms_datapump.metadata_filter(handle => l_dp_handle,
name => 'NAME_EXPR',
value => 'IN (''CLASS'')',
object_type => 'TABLE');
-- Exclude table stats
dbms_datapump.metadata_filter(handle => l_dp_handle,
name => 'EXCLUDE_PATH_EXPR',
value => 'IN (''STATISTICS'')');
dbms_datapump.start_job(l_dp_handle);
-- Wait for job
dbms_datapump.wait_for_job(handle => l_dp_handle,job_state => l_status );
dbms_output.put_line( l_status );
--Log_Message(PROCEDURE_NAME,'Completed DataPump Job');
-- Job will continue running the background until it completes or errors
--dbms_datapump.detach(l_dp_handle);
exception
when others then
--Log_Message(PROCEDURE_NAME,'Datapump job failed');
begin
dbms_datapump.detach(l_dp_handle);
execute immediate 'Drop table ' ||l_job_name ;
end;
end import_backup;
Have attempted using 1 record in exiting table and using APPEND - no results
Have attemped using 1 record in exiting table and using using TRUNCATE - the 1 record is deleted and replaced with the content of the dmp's CLASS table

Related

ORA-29913-Error executing call, after migrating the database to Exadata

I have a scheduler job which calls the procedure PR_DELETE_AUDIT_LOG. This code was working fine until the Oracle database was migrated to Exadata. Now whenever the job is executed we get the following errors as shown below.
ORA-29913: Error executing call
ORA-06512: in "ABC.PR_DELETE_AL_IMPORTLOG", AT LINE 49
ORA-06512: in "ABC.PR_DELETE_AL_IMPORTLOG", AT LINE 34
ORA-06512: in "ABC.PR_DELETE_AL_IMPORTLOG", AT LINE 34
The code for the job and the procedures are as follows.
DELETE_AL_IMPORTLOG_JOB
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'ABC.DELETE_AL_IMPORTLOG_JOB',
job_type => 'STORED_PROCEDURE',
job_action => 'ABC.PR_DELETE_AL_IMPORTLOG',
number_of_arguments => 0,
start_date => NULL,
repeat_interval => 'FREQ=DAILY;BYTIME=000000',
end_date => NULL,
enabled => FALSE,
auto_drop => FALSE,
comments => '');
DBMS_SCHEDULER.SET_ATTRIBUTE(
name => 'ABC.DELETE_AL_IMPORTLOG_JOB',
attribute => 'store_output', value => TRUE);
DBMS_SCHEDULER.SET_ATTRIBUTE(
name => 'ABC.DELETE_AL_IMPORTLOG_JOB',
attribute => 'logging_level', value => DBMS_SCHEDULER.LOGGING_OFF);
DBMS_SCHEDULER.enable(
name => 'ABC.DELETE_AL_IMPORTLOG_JOB');
END;
/
PR_DELETE_AL_IMPORTLOG
CREATE OR REPLACE EDITIONABLE PROCEDURE "ABC"."PR_DELETE_AL_IMPORTLOG"
AS
V_DELETION_DATE DATE;
CURSOR CUR_OLD_FILES
IS SELECT FNAME
FROM EXT_TAB_AL_IMPORTLOG_FILE_LIST
WHERE REGEXP_LIKE(FNAME,'AL_\d{2}-\d{2}-\d{2}_\d{8}_\d{6}.txt')
AND TO_DATE(SUBSTR(FNAME, -19,15),'YYYYMMDD_HH24MISS') < V_DELETION_DATE;
BEGIN
SELECT ADD_MONTHS
( TRUNC
( SYSDATE
, DECODE( STARTZEITPUNKTABF
, 1 ,'DD'
, 2 ,'MM'
, 3 ,'Q'
, 4 ,'YY'
,'DD'
)
)
, DECODE(PERIODEABF,2,-DAUERABF,3,-DAUERABF*12,0)) - DECODE(PERIODEABF,1,DAUERABF,0)
INTO V_DELETION_DATE
FROM LOESCHREGEL
WHERE VERWENDUNGSZWECK_ID = 'CLALL';
FOR REC_OLD_FILES IN CUR_OLD_FILES
LOOP
UTL_FILE.FREMOVE('ABC_AL_IMPORTLOG', REC_OLD_FILES.FNAME);
dbms_output.put_line('Deleted file '||REC_OLD_FILES.FNAME);
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
DECLARE
V_PROCEDURE_NAME VARCHAR2(30) := $$PLSQL_UNIT;
V_SUBJECT VARCHAR2(255) := 'Error on DB procedure '||V_PROCEDURE_NAME||' on '||to_char(sysdate,'dd.mm.yyyy hh24:mi:ss');
V_BODY VARCHAR2(10000) := 'Hi all,'||chr(10)||chr(10)||'Procedure '||V_PROCEDURE_NAME||' returned the following error:'||chr(10)||SQLERRM;
BEGIN
SEND_MAIL ( 'GENERIC_DB_ERROR', V_SUBJECT,V_BODY);
RAISE;
END;
END PR_DELETE_AL_IMPORTLOG;
/
DDL for Table EXT_TAB_AL_IMPORTLOG_FILE_LIST
CREATE TABLE ABC.EXT_TAB_AL_IMPORTLOG_FILE_LIST
( FNAME VARCHAR2(255 CHAR )
)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY COLEIN_AUDITLOG
ACCESS PARAMETERS
( RECORDS DELIMITED BY NEWLINE
PREPROCESSOR COLEIN_PROCESS:'AL_ImportLog_list_files.sh'
noLOGFILE
nobadfile
nodiscardfile
FIELDS TERMINATED BY WHITESPACE
)
LOCATION
( 'lsOutput.log'
)
)
REJECT LIMIT UNLIMITED ;
where is the problem?
The error seems to come from a value of ext_tab_al_importlog_file_list.fname that doesn't match the expected filename format. You might want to check the values to see which one is invalid and how it got there.
If you are using Oracle 12.2 or later, change the cursor to use an on conversion error clause:
select fname
from ext_tab_al_importlog_file_list
where regexp_like(fname, 'AL_\d{2}-\d{2}-\d{2}_\d{8}_\d{6}.txt')
and to_date(substr(fname, -19, 15) default null on conversion error, 'YYYYMMDD_HH24MISS') < v_deletion_date;
If not, you could try adding some more filters:
select fname
from ext_tab_al_importlog_file_list
where regexp_like(fname, 'AL_\d{2}-\d{2}-\d{2}_\d{8}_\d{6}.txt')
and to_date(substr(fname, -19, 15), 'YYYYMMDD_HH24MISS') < v_deletion_date
and to_number(substr(fname,-10,2)) < 24
and to_number(substr(fname,-8,2)) < 60
and to_number(substr(fname,-6,2)) < 60;
This worked in my quick test, but combining filters with a conversion function is risky because there is no guarantee that Oracle will apply the filtering conditions in any particular order.
You can find the invalid values using either of the following:
select fname
from ext_tab_al_importlog_file_list
where regexp_like(fname, 'AL_\d{2}-\d{2}-\d{2}_\d{8}_\d{6}.txt')
and to_date(substr(fname, -19, 15) default null on conversion error, 'YYYYMMDD_HH24MISS') is null;
select fname
from ext_tab_al_importlog_file_list
where regexp_like(fname, 'AL_\d{2}-\d{2}-\d{2}_\d{8}_\d{6}.txt')
and ( to_number(substr(fname,-10,2)) >= 24
or to_number(substr(fname,-8,2)) >= 60
or to_number(substr(fname,-6,2)) >= 60 );

How to create a job, when job_action need to call a procedure having CLOB parameter

I have a procedure which is being called at server side and I need to make it asynchronous.
So I have created another proc in which I'll create Oracle'Job and this will call that proc in its job_action.
Proc is:
PROCEDURE upload_csv_file_data(a_what_to_do IN VARCHAR2,
a_logon_user IN VARCHAR2,
a_csv_data IN CLOB)
IS
v_job_action VARCHAR2(32676);
/*v_log_error VARCHAR2(32676);*/
v_job_name VARCHAR2(100);
BEGIN
v_job_action := 'process_csv_file_data(''' || a_what_to_do || ''',''' || a_logon_user || ''',' || a_csv_data || ');';
v_job_name := 'UPLOAD_CSV_FILE_DATA';
sys.dbms_scheduler.create_job(
job_name => v_job_name,
job_type => 'PLSQL_BLOCK',
job_action => 'begin ' || v_job_action || ' EXCEPTION WHEN OTHERS THEN NULL; end;',
start_date => SYSTIMESTAMP,
job_class => 'BATCH_CLASS',
comments => 'Start uplaoding CSV file data.',
auto_drop => TRUE,
enabled => TRUE);
END;
Proc which needs to be called IN JOB is:
CREATE OR REPLACE PROCEDURE process_csv_file_data(a_what_to_do IN VARCHAR2,
a_logon_user IN VARCHAR2,
a_csv_data IN CLOB)
IS
.
/*STEPS*/
.
END;
But since one of the passing parameters for this PROC is CLOB hence whenever I'm trying to call is PROC using in JOB it throws an error "ORA-06502: PL/SQL: numeric or value error".
As job_action datatype is of VARCHAR2(4000); and hence the moment CLOB datatype is dynamically passed while calling the proc in the Job action it throws an error "ORA-06502: PL/SQL: numeric or value error"
Kindly suggest on this.
(can we pass the parameters using bind variables?)
The CLOB data has to come from somewhere. Instead of passing it as a parameter to the procedure you should stash it in a table which the job can read. Alternatively could you read the original source as a file, ideally as an external table, or as a BFILE.
SYSTIMESTAMP returns a TIMESTAMP WITH TIME ZONE value, so FROM_TZ(SYSTIMESTAMP, 'US/Eastern') is useless and it actually should return an error.
Data type of job_action is VARCHAR2, i.e. up to 32K characters, so CLOB is not possible.
Like APC I recommend a BFILE or an external table for processing.

Oracle PL/SQL dynamically create name for Procedure and Policy

I'm trying to see if the following would be possible.
it all hinges on creating Policies and Procedures for each row..
Is it possible to create a dynamically named Procedure and pass that name to a dynamically
named policy?
So as following create these in a loop ??
I have an email alert
CREATE OR REPLACE PROCEDURE caps_email_alert (sch varchar2, tab varchar2, pol varchar2)
AS
msg varchar2(20000) := 'CAPS.ME_PAYEE table violation. The time is: ';
BEGIN
msg := msg||to_char(SYSDATE, 'Day DD MON, YYYY HH24:MI:SS');
UTL_MAIL.SEND (
sender => 'me#somewhere.com',
recipients => 'me#somewhere.com',
subject => 'Table modification on caps.me_payee',
message => msg);
END caps_email_alert;
/
and a policy that will call it...
BEGIN
DBMS_FGA.ADD_POLICY (
object_schema => 'CAPS',
object_name => 'ME_PAYEE',
policy_name => 'CHK_CAPS_ME_PAYEE',
audit_column => 'CARRIER_NO',
audit_condition => 'CARRIER_NO = ''20'' ',
handler_schema => 'SYSADMIN_FGA',
handler_module => 'CAPS_EMAIL_ALERT',
enable => TRUE,
statement_types => 'SELECT, UPDATE',
audit_trail => DBMS_FGA.DB + DBMS_FGA.EXTENDED);
END;
/
I would need to write a subprogram that would execute as follows...
( to create a Procedure and Policy for each row )
BEGIN
FOR c IN (SELECT schema as sch, table as tab, cond as pred FROM slac_red_table) LOOP
--here need to create dynamically named procedure and pass it to a dynamically named policy
--so a function that creates a dynamically named procedure
emailerProcedureName emailerProcedureName%TYPE := emailerFunction(c.sch, c.tab)
createPolicyFunction(c.sch, c.tab, c.cond,emailerProcedureName)
END LOOP;
END;
Maybe I can accomplish the same some other way... have you encountered something similar ?

Generate the URL of a Remote File using PL/SQL

I created a Concurrent Program that creates an Excel File from a long, parametrized query using PL/SQL.
Once the Program successfully completes, the file is placed in the remote server's directory and is usually around 4 MB in Size.
I'm thinking of an approach to notify the requestor and enable him/her to save the file to their local directory.
However, I cannot use UTL_MAIL to attach and send the file via email due to the 32 Kilobyte Limitation. (Does UTL_MAIL have an attachment limit of 32k).
In the same post, Tom Kyte preferred approach would be to:
store the attachment to the database.
email a very small email with a link. the link points to my database - using a URL.
With that, i was thinking taking the same approach and use the block below to notify the requestor and enable him/her to download the said Excel file:
declare
l_url_link varchar2(100); -- how can i get the URL of the File?
BEGIN
UTL_MAIL.SEND(sender => 'xxx#oracle.com'
, recipients => 'Migs.Isip.23#Gmail.com'
, subject => 'Testmail'
, message => 'Your File is Ready to be downloaded, click the link here: '||l_url_link);
END;
My Questions would be:
How can i generate the "URL" of the Remote file using PL/SQL?
Do the users need to be granted access to the remote server to download the file?
Thank you!
Oracle Database Version:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
"CORE 11.2.0.4.0 Production"
TNS for Solaris: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
Here is a pl/sql function I wrote to retrieve the URL of either the concurrent log file or output file. If you write your Excel file to the concurrent output, this should work fine. Let me know how you get on. I have not checked to see if this will give the correct mime-type or extension - not sure how EBS handles this but the function itself will definitely compile as is for 12.1.3.
Spec
FUNCTION get_concurrent_url (p_file_type IN VARCHAR2
,p_request_id IN NUMBER
,p_expiry IN NUMBER)
RETURN VARCHAR2;
Body
/* Get a URL to view the log/output
File Type is LOG or OUT
Request ID is the concurrent request ID
Expiry is in minutes */
FUNCTION get_concurrent_url (p_file_type IN VARCHAR2
,p_request_id IN NUMBER
,p_expiry IN NUMBER)
RETURN VARCHAR2
IS
CURSOR c_gwyuid
IS
SELECT profile_option_value
FROM fnd_profile_options FPO
,fnd_profile_option_values FPOV
WHERE FPO.profile_option_name = 'GWYUID'
AND FPO.application_id = FPOV.application_id
AND FPO.profile_option_id = FPOV.profile_option_id;
CURSOR c_two_task
IS
SELECT profile_option_value
FROM fnd_profile_options FPO
,fnd_profile_option_values FPOV
WHERE FPO.profile_option_name = 'TWO_TASK'
AND FPO.application_id = FPOV.application_id
AND FPO.profile_option_id = FPOV.profile_option_id;
l_request_id NUMBER;
l_file_type VARCHAR2 (3 BYTE);
l_expiry NUMBER;
l_two_task VARCHAR2 (100 BYTE);
l_gwyuid VARCHAR2 (100 BYTE);
l_url VARCHAR2 (1024 BYTE);
BEGIN
l_request_id := p_request_id;
l_file_type := p_file_type;
l_expiry := p_expiry;
FOR i IN c_gwyuid LOOP
l_gwyuid := i.profile_option_value;
END LOOP;
FOR i IN c_two_task LOOP
l_two_task := i.profile_option_value;
END LOOP;
IF l_file_type = 'LOG' THEN
l_url := fnd_webfile.get_url
(file_type => fnd_webfile.request_log
,id => l_request_id
,gwyuid => l_gwyuid
,two_task => l_two_task
,expire_time => l_expiry);
ELSE
l_url := fnd_webfile.get_url
(file_type => fnd_webfile.request_out
,id => l_request_id
,gwyuid => l_gwyuid
,two_task => l_two_task
,expire_time => l_expiry);
END IF;
RETURN l_url;
END get_concurrent_url;
I was able to find a solution for this using a (slightly different) method using the FND_GFM File Uploader Package in Oracle EBS.
FND_GFM is a package usually used in Oracle EBS when uploading files from the front-end application pages.
First, generate the Excel file (xlsx) using the code from the previous post: Create an Excel File (.xlsx) using PL/SQL,
Then the file is inserted into FND_LOBS and removed the from the OS (for good housekeeping), and finally sent as an email using UTL_FILE:
procedure generate_and_send_excel
is
l_content varchar2(250);
l_file_url varchar2(4000);
l_directory varchar2(250);
l_filename varchar2(250);
l_message clob;
l_instance varchar2(100);
l_ebs_url varchar2(100);
begin
/* your excel generation code here */
l_content := 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
l_directory := 'EXT_TAB_DATA';
l_filename := 'report.xlsx';
select instance_name
into l_instance
from v$instance;
select home_url
into l_ebs_url
from icx_parameters;
IMPORT_TO_LOB (p_file_name => l_filename -- this is the actual filename of the saved OS File
, p_directory => l_directory -- should be a defined directory in the Database
, p_content_type => l_content -- standard for Excel Files
, p_program_name => 'your prog here'
, p_program_tag => 'your prog here'
, p_file_url => l_file_url); -- this will be the generated URL of your File
utl_file.fremove(l_directory, l_filename);
l_message := l_message||'<h2 style="color: #5e9ca0;">'||l_title||'</h2>';
l_message := l_message||'<h3 style="color: #2e6c80;">Report is Ready for Download: '||l_filename||'</h3>';
l_message := l_message||'<p>File was generated on '|| sysdate ||' from '||l_instance||'</p>';
l_message := l_message||'<strong>Regards,</strong><br/><strong>Sample Team</strong>';
l_message := l_message||'<br/>Sample#sample.com';
UTL_MAIL.SEND(sender => 'SAMPLE#SAMPLE.com'
, recipients => 'Migs.Isip.23#gmail.com'
, subject => 'Hello message'
, message => l_message
, mime_type => 'text/html; charset=us-ascii');
end generate_and_send_excel;
Procedure below to insert into FND_LOBS (there's no available seeded API):
Procedure IMPORT_TO_LOB (p_file_name IN FND_LOBS.FILE_NAME%TYPE
, p_directory IN dba_directories.directory_name%type
, p_content_type IN FND_LOBS.file_content_type%type
, p_program_name IN FND_LOBS.program_name%type
, p_program_tag IN FND_LOBS.program_tag%type
, p_language IN FND_LOBS.language%type default 'US'
, p_file_format IN FND_LOBS.file_format%type default 'binary'
, p_file_url OUT varchar2)
IS
PRAGMA AUTONOMOUS_TRANSACTION;
lBlob BLOB;
lFile BFILE := BFILENAME(p_directory, p_file_name);
L_ORA_CHARSET VARCHAR2(100);
P_COUNT NUMBER;
BEGIN
SELECT value
into l_ora_charset
FROM nls_database_parameters
where parameter = 'NLS_CHARACTERSET';
insert into FND_LOBS
(
file_id
, file_name
, file_content_type
, file_data
, upload_date
, expiration_date
, program_name
, program_tag
, LANGUAGE
, oracle_charset
, file_format
)
values
(
fnd_lobs_s.NEXTVAL -- FILE_ID
, p_file_name -- FILE_NAME
, p_content_type -- FILE_CONTENT_TYPE
, EMPTY_BLOB() -- FILE_DATA
, sysdate -- UPLOAD_DATE
, NULL -- EXPIRATION_DATE
, p_program_name -- PROGRAM_NAME
, p_program_tag -- PROGRAM_TAG
, p_language -- LANGUAGE
, l_ora_charset -- ORACLE_CHARSET
, p_file_format -- FILE_FORMAT
)
RETURNING file_data INTO lBlob;
DBMS_LOB.OPEN(lFile, DBMS_LOB.LOB_READONLY);
DBMS_LOB.OPEN(lBlob, DBMS_LOB.LOB_READWRITE);
DBMS_LOB.LOADFROMFILE(DEST_LOB => lBlob,
SRC_LOB => lFile,
AMOUNT => DBMS_LOB.GETLENGTH(lFile));
DBMS_LOB.CLOSE(lFile);
DBMS_LOB.CLOSE(lBlob);
commit;
p_file_url := fnd_gfm.construct_download_url (fnd_web_config.gfm_agent, fnd_lobs_s.currval);
END IMPORT_TO_LOB;
Note that this is an AUTONOMOUS_TRANSACTION so it needs to be committed before returning to the calling package/block.
Hope that Helps!

How do I call a function from within a PL/SQL process within Oracle APEX 4.2

I've created a new function called GET_FILENAME inside my Oracle APEX database. I'd like to call this function from within a APEX PL/SQL code block and pass it the filename. Below is the function I created in my APEX DB with SQL Dev.
create or replace function get_filename
(p_path IN VARCHAR2)
RETURN varchar2
IS
v_file VARCHAR2(100);
BEGIN
-- Parse string for UNIX system
IF INSTR(p_path,'/') > 0 THEN
v_file := SUBSTR(p_path,(INSTR(p_path,'/',-1,1)+1),length(p_path));
-- Parse string for Windows system
ELSIF INSTR(p_path,'\') > 0 THEN
v_file := SUBSTR(p_path,(INSTR(p_path,'\',-1,1)+1),length(p_path));
-- If no slashes were found, return the original string
ELSE
v_file := p_path;
END IF;
RETURN v_file;
END;
APEX side of things....
Below is the code I'd like to put in when calling the process.
TO_DATE(SUBSTR(GET_FILENAME(file_date),21,8),'YYYY-MM-DD')
Below is the apex process code and the comments are where I'd like to put it in.
BEGIN
APEX_COLLECTION.ADD_MEMBER
(
p_collection_name => 'PARSE_COL_HEAD',
p_c001 => 'C031',
p_c002 => 'FILE_DATE');
FOR UPLOAD_ROW IN (SELECT SEQ_ID FROM APEX_COLLECTIONS
WHERE COLLECTION_NAME = 'SPREADSHEET_CONTENT')
LOOP
APEX_COLLECTION.UPDATE_MEMBER_ATTRIBUTE (
p_collection_name => 'SPREADSHEET_CONTENT',
p_seq => UPLOAD_ROW.SEQ_ID,
p_attr_number => '31',
p_attr_value => :P25_FILE_NAME -- I want to call the process here
);
END LOOP;
END;
I don't normally answer my own question. But this was easier than I thought :). Below is the code I used to get this working....
BEGIN
APEX_COLLECTION.ADD_MEMBER
(
p_collection_name => 'PARSE_COL_HEAD',
p_c001 => 'C031',
p_c002 => 'FILE_DATE');
FOR UPLOAD_ROW IN (SELECT SEQ_ID FROM APEX_COLLECTIONS
WHERE COLLECTION_NAME = 'SPREADSHEET_CONTENT')
LOOP
APEX_COLLECTION.UPDATE_MEMBER_ATTRIBUTE (
p_collection_name => 'SPREADSHEET_CONTENT',
p_seq => UPLOAD_ROW.SEQ_ID,
p_attr_number => '31',
p_attr_value => TO_DATE(SUBSTR(GET_FILENAME(:P25_FILE_NAME),21,8),'YYYY-MM-DD')
);
END LOOP;
END;

Resources