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: How to find the name of the schema on an existing Oracle 7 Database?

Re: How to find the name of the schema on an existing Oracle 7 Database?

From: Marc Billiet <Marc.Billiet_at_hae.hydro.com>
Date: 1998/10/06
Message-ID: <3619B91D.578F@hae.hydro.com>#1/1

If you want the name of the schema of the current session, you can use the variable USER.
We use e.g. following function to check whether the current session is logged in as the owner of the procedure or as someone with execute privilege (on our current system, only the developer is allowed to work on the tables and procedures/functions/packages directly):

  FUNCTION user_is_developer
    RETURN BOOLEAN
  IS
    l_owner VARCHAR2(30);
  BEGIN
    SELECT username
    INTO l_owner
    FROM user_users;

    RETURN (l_owner = USER);
  END user_is_developer;

This function returns TRUE if the current user is the same is the schema the procedure has been created in, and FALSE if not.

Marc

m.L. wrote:
>
> Hello everyone,
>
> In one of our client databases, I need to find out the name of
> the schema in a hurry. I looked around. Apparently, user_tables has
> no such information. Should I try svrmgr?
> any help will be very much appreciated.
>
> If you don't mind, please forwar the information to
> <mleung_at_intelus.com>. I will try to check this newsgroup later, but
> the sooner I get this information is better.
>
> Thanks in advance
>
> michael
  Received on Tue Oct 06 1998 - 00:00:00 CDT

Original text of this message

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