Hi Joe. For the background page process, you would have to submit the page and run a background page process, which is not what you want.
You could add the parameters to a table (and probably the session id), and launch an APEX Automation to run in the background (p_run_in_background = TRUE). The Automation would pick the parameters up from the table and run your code.
APEX_AUTOMATION.EXECUTE (
p_application_id IN NUMBER DEFAULT {current application id},
p_static_id IN VARCHAR2,
p_run_in_background IN BOOLEAN )
If you then need to pickup the results you can do so using the session ID.
Otherwise, you could go with DBMS_SCHEDULER
BEGIN
-- Create the job
DBMS_SCHEDULER.create_job (
job_name => 'MY_SCHEDULER_JOB',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN my_procedure(:param_value); END;',
number_of_arguments => 1,
start_date => SYSTIMESTAMP,
repeat_interval => NULL, -- Set if recurring; NULL for one-time execution
enabled => FALSE -- Disable until arguments are set
);
-- Set the parameter for the job
DBMS_SCHEDULER.set_job_argument_value (
job_name => 'MY_SCHEDULER_JOB',
argument_position => 1,
argument_value => 'Sample Parameter Value' -- This is the parameter you are passing
);
-- Enable the job (so it can run)
DBMS_SCHEDULER.enable('MY_SCHEDULER_JOB');
-- Optionally run the job immediately (without waiting for scheduled time)
DBMS_SCHEDULER.run_job('MY_SCHEDULER_JOB');
END;