Home » SQL & PL/SQL » SQL & PL/SQL » Query on message at login
Query on message at login [message #37416] Wed, 06 February 2002 18:51 Go to next message
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 #37423 is a reply to message #37416] Thu, 07 February 2002 00:49 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member

Go to oracle_home/dbs/login.sql and add
select 'hello welcome'from dual

Re: Query on message at login [message #37438 is a reply to message #37423] Thu, 07 February 2002 10:51 Go to previous message
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
if ( user = 'VDS' ) then
dbms_output.put_line('Hello Welcome');
end if;
Previous Topic: verry urgent..how to insert 123.45(char) to another table column of datatype number
Next Topic: dynamic pl/sql method 4
Goto Forum:

Current Time: Fri Sep 24 14:23:38 CDT 2021