tags:

views:

31

answers:

2

I have a few sql scripts that I need to run via SQL*Plus. These scripts connect several times as different users with a connect user_01/pass_01@db_01. Now, each time the script does such a connect, it confirms the successful connection with a connected. This is distracting and I want to turn it off.

I can achieve what I want with a

set termout off
connect user_01/pass_01@db_01
set termout on

Is there a more elegant solution to my problem?

Note, it doesn't help to permanently set termout off at the start of the script since I need to know if a command didn't run successfully.

+2  A: 

Here's a tip I've used from Tom Kyte's book (forget which one). I have a script called connect.sql in my sqlplus directory:

set termout off 
connect &1 
@login

and in my glogin.sql I've added this:

select lower(user) || '@' || 
substr( global_name,1, decode( dot, 0, length(global_name), dot-1) ) 
global_name 
from (select global_name, instr(global_name,'.') dot from global_name );

set sqlprompt '&gname> '

set termout on

then I call

@connect user_01/pass_01@db_01

instead of

connect user_01/pass_01@db_01
davek
Seems this is the closest I can get.
René Nyffenegger
A: 

If it really bothers you you could try

SQL> set feedback off
SQL> alter session set current_schema=SCOTT;

But this may not meet your needs ....

pj
Thanks! And yes, it doesn't meet my needs.
René Nyffenegger