Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help need!!

Status
Not open for further replies.

rmutyapu

IS-IT--Management
Nov 2, 2001
24
US
Hi All,

I am new to this Oracle9i. Sql file: test.sql

Can anyone tell me how can I run the sql script (test.sql)from command line without suppling the username/password and connect string.

My sql script:

test.sql
--------
select username from user_users;

My shell script:

test.sh
-------
sqlplus -s / <<!!
@/home/testing/test.sql
!!

Thanks in advance for your kind help.

RM
 
I'll add...

Using /nolog, once you are in SQL*Plus (you are not connected),you need to issue a &quot;CONNECT&quot; statement.

$ sqlplus /nolog
SQL> connect scott/tiger
SQL> select * from emp;
...


If you don't issue the CONNECT, you get:
SQL> select * from emp;
SP2-0640: Not connected


Thomas V. Flaherty Jr.
Birch Hill Technology Group, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top