File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes sqlplus and shell script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "sqlplus and shell script" Watch "sqlplus and shell script" New topic

sqlplus and shell script

Rahuul Dravid
Ranch Hand

Joined: Feb 17, 2009
Posts: 42
Hi Folks,

I have a some issues with calling sqlplus form shell script.
I can run the sqlplus command form the home of the user directory ( i set the alias for sqlplus by editing the .bash_profile of that user ....every thing is fine.
home:> sqlplus
I can connect to db

Now when i try to run the same sqlplus from the a shell script like with sqlplus command inside the

it says command not found .

i tried to edit the even the etc/bashrc file but .... it is same

So how to fix this so that the sh can get the path variable in linux ( red hat AS 5)

Do i need to edit define any variables ???

I think i set the Path correctly , if not it should not work from the home directory i guesss .....correct me if i'm wrong !

Thanks in advance !
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17421

Issue the command "which sqlplus". It will display the full pathname of the executable. You should be able to invoke sqlplus from a script if you use the full pathname.

An IDE is no substitute for an Intelligent Developer.
Rahuul Dravid
Ranch Hand

Joined: Feb 17, 2009
Posts: 42

Thanks for the reply Tim

well i think i figured it out , there is the path issues .....and now it is fixed !

Thanks guys !

I agree. Here's the link:
subject: sqlplus and shell script
jQuery in Action, 3rd edition