Query on message at login [message #37416] |
Wed, 06 February 2002 18:51 |
Ganesh.d
Messages: 2 Registered: February 2002
|
Junior Member |
|
|
Hello Friends
I'm having a schema name VDS
What i want is when i want to enter to this schema through sql plus I have to get the message "Hello Welcome",How to write a trigger for this one
|
|
|
|
Re: Query on message at login [message #37438 is a reply to message #37423] |
Thu, 07 February 2002 10:51 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
In your default sqlplus directory, add on of the following to login.sql
-- same message for any schema
1.) prompt Hello Welcome
-- message for only VDS schema, only whensqlplus is started.
-- Use noprint or headding off to suppress column heading if you want
2.) select 'Hello Welcome' from dual where user='CDS';
To be able to get the message when you issue "connect vds/pass" from sqlplus, you'd need a login trigger.
-- Add to login.sql
3.) set serveroutput on
Create a login trigger (from system account or other DBA priv A/C). Watch out - if you mess this trigger up you will have problems logging in!
create or replace trigger logon_trigger
after logon on database
begin
if ( user = 'VDS' ) then
dbms_output.put_line('Hello Welcome');
end if;
end;
/
|
|
|