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: invoking login.sql from connect ?

Re: invoking login.sql from connect ?

From: Jurij Modic <jmodic_at_src.si>
Date: Tue, 29 Sep 1998 14:50:32 GMT
Message-ID: <3610f038.5817603@news.siol.net>


On Tue, 29 Sep 1998 14:16:14 GMT, learmog_at_my-dejanews.com wrote:

>Is it possible to automatically invoke a sql script e.g. login.sql when using
>the connect command within SQL*Plus ? I currently have a login.sql that sets
>my prompt based on the v$database.name. The only problem is once logged in if
>I re-connect to another DB, the prompt doesn't get changed accordingly. Any
>ideas ?

Create another SQL*Plus script which will actualy execut the connect and will also call login.sql. Then instead of using CONNECT command use the CONNECT.SQL script

Example of CONNECT.SQL:



CONNECT &1
@login.sql

Usage:



Instead of using "CONNECT SCOTT/TIGER_at_ANOTHER_DB" from SQL prompt, use "@CONNECT.SQL SCOTT/TIGER_at_ANOTHER_DB" and login.sql will take care of your new SQL prompt.

HTH,
--
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)



The above opinions are mine and do not represent any official standpoints of my employer Received on Tue Sep 29 1998 - 09:50:32 CDT

Original text of this message

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