Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Background Process in APEX

567066Nov 22 2010 — edited Dec 17 2010
Hi All,

I have the below code in the after submit process in one of the APEX page/screen and trying to run the below process in background , after submitting the process it comes back to the page immediately ( which is what I wanted) and launch the program code to run the program in back ground, but looks like its not doing the background process. ( not able to see any records populated into the custom table I use). Please advise whether I am missing anything or any changes are required on teh below program code.
Below is the code I am currently using. When I try to run the process without any background submission , it takes around 20-30 minutes, and give the expected results and workd just fine. please give your expert advice on this when time permits..

Thanks
Sheik


DECLARE
l_sql long;
l_job number;
l_return Varchar2(32767) ;
l_messages dbms_output.chararr;
l_numlines integer := 1000000;

Begin


l_sql := 'BEGIN
MEDDEV.DSD_MED_FIN_MAC_EXTRACT.MAIN(
P_PERIOD_ID => :P778_PERIOD_ID,
P_OVERRIDE => :P778_OVERRIDE,
P_RESULT => :P778_RESULT);
END;';

dbms_scheduler.create_job
(job_name => 'APEXEDIT',
job_type => 'PLSQL_BLOCK',
job_action => l_sql,
enabled => true);

l_job := APEX_PLSQL_JOB.SUBMIT_PROCESS(
p_sql => l_sql,
p_status => 'Background process submitted'
);
END;
This post has been answered by fac586 on Dec 3 2010
Jump to Answer

Comments

Sarah QA
hi

:system.message_level:-

If you want to suppress error messages then you have to set a system variable :system.message_level. I use to set this system variable in a Pre-Form trigger. There is no restriction in using this variable. You can set it to difference values in each Pre-Block triggers if you want.

SYSTEM.MESSAGE_LEVEL stores one of the following message severity levels: 0, 5, 10, 15, 20, or 25. The default value is 0. Form Builder does not suppress prompts or vital error messages, no matter what severity level you select.

Assume that you want Form Builder to display only the most severe messages (level 25). The following Pre-Form trigger suppresses all messages at levels 20 and below.

:System.Message_Level := '20';

If you want to display your own message then it can be done in On-Message and On-Error triggers.

One can either set the message level using the system variable SYSTEM.MESSAGE_LEVEL or trap errors using the ON-ERROR or ON-MESSAGE triggers. 

MESSAGE_LEVEL: 

Set to 0, 5, 10, 15, 20, 25 to suppress all messages with severity below this level. The default level is 0. Messages with a level higher than 25 cannot be suppressed. See the "Forms Error Messages Manual" for more details about the various MESSAGE_LEVEL's: 

0 - Default value. All types of messages from the other levels of severity. 
5 - Reaffirms an obvious condition. 
10 - Indicates that the operator has made a procedural mistake. 
15 - Declares that the operator is attempting to perform a function for which the form is not designed. 
20 - Indicates a condition where the operator cannot continue an intended action due to a problem with a trigger or another outstanding condition. 
25 - Indicates a condition that could result in the form performing incorrectly. 
25 - Indicates a message severity level that you cannot suppress via the SYSTEM.MESSAGE_LEVEL system variable.
examples:-
:SYSTEM.MESSAGE_LEVEL := '25';
COMMIT;
:SYSTEM.MESSAGE_LEVEL := '0';
/* For suppressing FRM-40100: At first record. */
:SYSTEM.MESSAGE_LEVEL := '5';
FIRST_RECORD;
:SYSTEM.MESSAGE_LEVEL := '0';
/* For suppressing FRM-40350: Query caused no records to be retrieved. */
:SYSTEM.MESSAGE_LEVEL := '5';
EXECUTE_QUERY;
:SYSTEM.MESSAGE_LEVEL := '0';
sarah
Arunkumar Ramamoorthy-Oracle
Hi,

As mentioned there, every message/error/warning that are displayed in forms are of a pre-defined message level, depending on the severity of the message/warning/error.

So, during some operation, if you want to display some message/warning/error that is of some level and ignore the rest, you will be setting :SYSTEM.MESSAGE_LEVEL.

For ex, if you set the :SYSTEM.MESSAGE_LEVEL to 25, the messages/warnings/errors that or having the level below 25 would be suppressed and only the messages that are having message level >=25 would be displayed.

Edit : In brief, for your question, message level is the pre-defined level for any FRM message and actual level is what you set with :SYSTEM.MESSAGE_LEVEL.

-Arun
shabar
Hi Sarah

Thax for the reply.

I agreed with what you mentioned. But I need to know; Are there two different values called message-level and actual level (in system setting)



rgds


shabar
shabar
Thax Arun

Your reply cleared me to some extent.

Further I need to know, to decide which errors should be suppressed and which are not, first need to get the message level values of all messages (that means there can be different system_level for each messages) and then only have to decide on the value that should assign for
:SYSTEM_LEVEL := ??  
rgsd


shabar
François Degrelle
SYSTEM.MESSAGE_LEVEL uses only ranges of severity from 5 to 5 (5-10-15-20-25). You need to know what range to display.

Francois
shabar
Hi Francois

If want to suppress only 10 and 15, How should be set the message_level value?

and

How to extract the pop up messages values?



rgds

shabar
François Degrelle
During a Runform session, Oracle Forms suppresses all messages with a severity level that is the same or lower (less severe) than the indicated severity level.

You cannot suppress "only" messages from range 10 to 15. You can suppress any messages that severity is lower or equal to the number you put in the MESSAGE_LEVEL variable.

:SYSTEM.MESSAGE_LEVEL := 15 will suppress any message that severity code is 15 or lower.

Francois
shabar
As per the previous post.....

>
/* For suppressing FRM-40350: Query caused no records to be retrieved. */
:SYSTEM.MESSAGE_LEVEL := '5';
EXECUTE_QUERY;
:SYSTEM.MESSAGE_LEVEL := '0';
>

Why it set to --> 0 after suppress


>
How to extract the message_level values before suppress?
>

Is this possible


rgds


Shabar
François Degrelle
This code is used to suppress the message "x records saved..." or "nothing to save..." message at commit time. The value is set back to 0 after to ensure every messages will be displayed.

Francois
shabar
Thax a lot guys :)



rgds

Shabar
1 - 10
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 14 2011
Added on Nov 22 2010
17 comments
4,776 views