Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Resetting state of PL/SQL package
Vladimir M. Zakharychev wrote:
> "Karsten Farrell" <kfarrell_at_belgariad.com> wrote in message
> news:DPZW9.42$Lo2.2_at_newssvr19.news.prodigy.com...
>
>>Do you just want to allow any session to *set* a package variable and >>allow any session to *see* the current value of that variable? If so, >>can you provide procedures/functions in the package to: >> >>set_variable(new_value); >>cur_value := get_variable; >> >>Then grant execute on the package to the world. >> >>As long as you don't close the session that's running the package, other >>sessions can use the get/set routines.
For example, I once wrote a package that sent back or modified info about an Oracle user's account - stuff like their roles or password. A copy of the package ran on each instance/database. Suppose, for example, I entered the information (such as a new password) while connected to DB_ONE, then called each of the "remote" packages on DB_TWO, DB_THREE, and so on. They each updated the account on their respective local database. So not only was I able to enter the info once, but I was able to affect databases thru db links. I could also request, and receive, account info from these remote databases. I just couldn't directly update any package variables remotely. And the packages had to be running all the time or the whole thing would fall apart.
That was in Oracle7 days ... and there are better ways to do it with the more recent versions. But that was a simple solution to allow me to enter the info once and not have to connect to each database and enter the same ALTER USER command multiple times. Received on Tue Jan 21 2003 - 10:34:36 CST