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

Home -> Community -> Usenet -> c.d.o.misc -> Re: login.sql script

Re: login.sql script

From: Chris Hamilton <chrish_at_cmprime.att.com>
Date: 1997/03/27
Message-ID: <01bc3ae4$13456240$2d89b687@chrish-pc.cis.att.com>#1/1

About that login.sql file . . .

Okay, I answered my own question. And yes, I should have known better. Unfortunately, in my old job I used only the centralized glogin.sql exclusively rather than my own login.sql, so I didn't have all the info on this.

> For a reason that I am unable to determine, SQL*Plus sometimes executes
 the
> script and it sometimes does not.

I figured out that it would execute only if I were in my home directory (where the script is located). For some reason, I had gotten it into my head many moons ago that SQL*Plus on Unix looks in your home directory (only) for the login.sql script (not in SQLPATH like for other SQL scripts). Duh. So I checked the SQL*Plus User's Guide, and I'll be darned, there on Page 3-15 . . .

"when you start SQL*Plus, it automatically searches for your LOGIN file (first in your local directory and then on a system-dependent path) and runs the commands it finds there. "

I modified my SQLPATH variable to include my home directory and all was well. I guess I'll move the script to another location (I hate stuff in my home directory!) now that I realize that SQLPATH searches for login.sql as well.

For those who weren't aware of it, SQLPATH is an environment variable that determines where SQL*Plus looks for scripts if not in the current directory. Mine is set via ...

SQLPATH=.:$DBA/scripts:$HOME

All that was startlingly obvious in retrospect!

Chris



Chris Hamilton -- chrish_at_cmprime.att.com DBA, AT&T WorldNet Service - Lincroft, NJ http://www.serve.com/cowpb/chamilton.html Received on Thu Mar 27 1997 - 00:00:00 CST

Original text of this message

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