permaculture playing cards*
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "sqlplus and shell script" Watch "sqlplus and shell script" New topic
Author

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
SQL>

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

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: 16020
    
  20

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
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 !


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: sqlplus and shell script