Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How I get Schema-Name from sql query
This is incorrect.
select USER from dual will tell you the current user, not the current schema. It is possible for the current schema to be different from the current user.
SQLWKS> connect bennettp_at_lto8
Connected.
SQLWKS> select USER from dual
2>
USER
2>
COUNT(*)
10172
1 row selected.
SQLWKS> select count(*) from assignment
2>
select count(*) from assignment
*
2>
Statement processed.
SQLWKS> select count(*) from assignment
2>
COUNT(*)
10172
1 row selected.
SQLWKS> select user from dual
2>
USER
The schema = MDA, but the USER = bennettp
RC wrote:
> pook4431 wrote:
> >
> >
> > How I get schema name for schema that I'm using by sql query?
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> Try select USER from dual; That will give you the schema that is currently
> running.
>
> HTH
>
> RC
>
> --
> Posted via CNET Help.com
> http://www.help.com/
Received on Tue Jan 04 2000 - 18:38:35 CST
![]() |
![]() |