Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Determine then name of the DB inside a Stored Procedure

Re: Determine then name of the DB inside a Stored Procedure

From: <michael_bialik_at_my-deja.com>
Date: Thu, 21 Oct 1999 22:54:00 GMT
Message-ID: <7uo5i7$pog$1@nnrp1.deja.com>


Hi.

 I think the simpliest solution is
  Either
  Ask your DBA to

     "GRANT SELECT ON SYS.V$DATABASE TO PUBLIC;"
     In you SP - make a select from it.
  Or
  if you can not do it - ask DBA to write a SP that   makes a SELECT and returns database name.   Ask him to GRANT EXECUTE ON <sp> TO PUBLIC;

  HTH. Michael.
  P.S. In my place we have a lot of users with access

       rights to V$....

In article <7un4f3$3gq$1_at_duke.telepac.pt>,   "Rui Anastácio" <coreto03_at_axa-seguros.pt> wrote:
> I have a procedure that writes a file to the system via utl_file.
Since I
> have to indicate the directory and this changes from development to
test and
> production I need to change the Stored Procedure upon compiling in
different
> DB's (the problem).
>
> I could solve the problem if I knew the database name from the
procedure.
> Then I could write the file to the corresponding place.
>
> USERENV might be a solution
> V$ is for SYS only right ?
> DBMS_APPLICATION_INFO might do it but I don't have the info. Anyone ?
>
> Any other way ?
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Oct 21 1999 - 17:54:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US