Re: pl/sql

From: Suresh Bhat <suresh.bhat_at_mitchell-energy.com>
Date: Fri, 02 Jul 1999 15:07:04 GMT
Message-ID: <01bec4ac$f86f1100$a504fa80_at_mndnet>


HI -

You can inititalize a variable(s) whenever ANY PROCEDURE is called in a a package as follows.
This is a snip from an actual working package and system. Hope I have not left any critical stuff.

create or replace
package pkg_process_data
is
/*

   This is package specification. Declare here globals and other common variables, cursors,

   procedure stubs etc.
*/

   global_update_user_id        varchar2(   31);
   global_update_date            date;

   --
END; -- of specification for package pkg_process_data /
--
create or replace
package body    pkg_process_data
is
procedure       proc1
               (debug                   in      boolean default FALSE )
is
BEGIN

....
....
END; -- procedure proc2 is BEGIN
....
....
END; -- BEGIN -- Initialization of Package Body /* pkg_general is another package with common procedures used by many other packages. The statement below is executed only once whenever any of the objects/procedures in this package, pkg_process_data, are accessed the first time. global_update_user_id and global_update_date assigned below will be available to procedures proc1, proc2 or any procedure within the package pkg_process_data. */ pkg_general.get_session_info ( global_update_user_id, global_update_date ); END; -- of body for package pkg_process_data / Hope that helps. Later !!! Suresh Bhat Oracleguru www.oracleguru.net DooHee Kim~ <4658291d_at_taurus.oac.uci.edu> wrote in article <Pine.SOL.4.05.9907011448240.995-100000_at_taurus.oac.uci.edu>... > I'm using pl/sql and oracle databse for online banking and need help in > controlling the user session. > The way the program works, once a user logs in and enters password > correctly, packet called usersession holds a temporary ID. > > Every pages in online banking checks at beginning whether usersession > packet has an ID or not, if there is not, then the page writes that > session expired and if there is one, the page loads. > However, I can't get the ID to be available to every procedures. > The value is visible at the current procedures and the value is destroyed > when another page is loaded. > > Can someone tell me what I'm doing wrong or if there is a better way to > controld a user session? > Thanks in advance. > >
Received on Fri Jul 02 1999 - 17:07:04 CEST

Original text of this message