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

Home -> Community -> Usenet -> c.d.o.server -> Re: Changing default schema at logon

Re: Changing default schema at logon

From: Brian Tkatch <SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK>
Date: Sun, 01 Jul 2001 16:32:31 GMT
Message-ID: <3b3f5064.760702390@news.alt.net>

On 30 Jun 2001 00:50:48 -0700, goryunov_at_braz.ru (Andrey Goryunov) wrote:

>SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK (Brian Tkatch) wrote in message news:<3b3ce8a6.603072921_at_news.alt.net>...
>> I have one user with no quotas. The user's single purpose is to use a
>> specific schema. While testing as that user, it becomes quite
>> cumbersome to type in the schema name all the time.
>>
>> I created a trigger to change the current schema at logon time.
>>
>> The user is "MOO" and the schema to be used is "COW".
>>
>> CREATE OR REPLACE TRIGGER Moo.Change_Default_Schema_To_Cow
>> AFTER LOGON ON Moo.SCHEMA
>> BEGIN
>> EXECUTE IMMEDIATE 'ALTER SESSION SET Current_Schema = Cow';
>> END Change_Default_Schema_To_Cow;
>> /
>>
>> This seems to work. That is, when Moo logs on he can do a DESC on an
>> object in Cow without the schema qualifier. When logging on as another
>> user, the schema is not changed. So, I'll assume that I got this part
>> correct.
>>
>> This all works when I log in via SQL*Plus. However, when I log in via
>> some other GUI (E.G. PL/SQL Developer or TOAD), doing a DESC on the
>> same object fails.
>>
>> Obviously, I would like it to work there as well, but I am not sure
>> how to proceed.
>>
>> Brian
>
>Hi,
>Desc command is SQLPlus command. I don't think it supported in
>third-party tools, execute select ... from table_name where rownum < 3
>(for example) in Developer to evaluate your trigger.
>

Well, I used a command window. But you are correct. While a DESC failed, a SELECT COUNT(*) worked. Go figure.

Brian Received on Sun Jul 01 2001 - 11:32:31 CDT

Original text of this message

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