oracle execute plsql code before the stored procedure call

It sounds like what you are doing is logging into a application, so is the requirement actually to call a LOGIN procedure within that application. The question posed by @Del is the pertinent question. If the answer is before each procedure execution to the application then you need to call that LOGIN procedure just before you call another procedure with in that application. If however it is a once per session requirement then there is effectively an ‘automatic’ process.
You need to put all your calling interface routines into a single package. In addition to defining procedures and functions the package itself has an execution section. This section is automatically executed when the package is loaded. The package loads with the first call to any of its functions or procedure.
The following shows a skeleton of your needed package. (body only)

create or replace package interface_other_app as 
   procedure1 ... end procedure1; 
   procedure1 ... end procedure2; 
   last_procedure ... end last_procedure; 
BEGIN   -- package initialization. The code in here runs once when the pacaage is loaded. 
   other_app.login(application login parameters); 
end interface_other_app;



      

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top