Hello,
our goal is to call a procedure in a package every time any procedure/function in the same package is invoked.
That procedure checks something, and if it returns "true", it can execute the code of the procedure/function.
I try to better explain myself.
Let's create this Package Body:
CREATE OR REPLACE PACKAGE BODY test as
procedure set_format is
begin
execute immediate 'alter session set NLS_territory=ITALY';
execute immediate 'ALTER SESSION SET NLS_DATE_FORMAT=''dd-mm-yyyy''';
end;
function get_number return float is
begin
return(123);
end;
END test;
If I call, via PL/SQL, the "get_number" function, I receive as expected the value "123":
SELECT test.get_number from dual
I want to add a function to this package, which is called every time I call the "get_number" function or any other procedure or function contained in the package.
I tried:
1) initialization: unfortunately it's executed only once, when the package is called the first time
2) PRAGMA SERIALLY_REUSABLE: unfortunately, i can't call any function or procedure via PL/SQL
So... I'm stuck.
Any ideas?
Thank you in advance.