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!

Apex - PLSQL - PLSQL Code structure in APEX

Jasper TanglibApr 26 2021

Hi,
In Oracle 20.2, I have a code or Process in Oracle Apex and it has 52 unique conditions so it is kind of lengthy. It is about extracting contents of a file, there are 51 specific file names to consider plus the else condition, read its data, insert into a temporary table, and then inserting into a final big table.
There are two ways I know on how I can implement my code.
First is I can have all the code in 1 script or procedure in my database and then I will use Apex Process to call that procedure:
Example:
In database:
create or replace my_procedure as
begin
--52 conditions here;
end;
In Apex PLSQL process:
my_procedure();

Second way is, I have the option to reduce the code by creating a separate procedure for each 52 conditions.
Example:
In database:
create or replace first_condition_procedure as
begin
-- unique process here;
end;
create or replace second_condition_procedure as
begin
--unique process here;
end;
--and 50 more...
In Apex PLSQL process:
BEGIN
IF THEN
first_condition_procedure();
ELSIF THEN
second_condition_procedure();
--and 50 more...
END IF
END;

I am trying to consider the performance or impact it may have on the application.
Is there any advantage or disadvantage among the 2 different structures or will they be pretty much the same?

Any idea is appreciated!
-Jazz

Comments

Post Details

Added on Apr 26 2021
3 comments
167 views