The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Running UNIX commands remotely in Windows box from Unix box – avoid entering password D.kalpana UNIX for Dummies Questions & Answers 1 04-20-2007 02:24 AM
How to use unix commands in awk jerome Sukumar Shell Programming and Scripting 7 12-26-2006 04:15 AM
Need help on Unix commands. adngu3 High Level Programming 1 03-09-2005 06:21 AM
Maingrame to UNIX sending UNIX commands skammer UNIX for Dummies Questions & Answers 2 06-27-2002 09:19 AM
Unix Commands smdakram UNIX for Dummies Questions & Answers 2 01-13-2002 04:12 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-19-2006
Registered User
 

Join Date: May 2006
Posts: 16
SQL Commands in Unix

Hi gurus,

Being a newbie not sure whether iam asking the right question?

can we use oracle commands in unix for ex: to read a count on a table.

if so, what needs to be configured and etc..

any kind of help is appreciated.

Thanks
sish
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-19-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,502
Code:
sqlplus -s <<EOF
$user/$passwd@oracle_instance
select count(*) from mytable;
exit
EOF
sqlplus has to be in your PATH.
Reply With Quote
  #3 (permalink)  
Old 05-19-2006
Registered User
 

Join Date: May 2006
Posts: 16
Hi Jim

That works perfectly.

Thanks for the earliest reply.

sish
Reply With Quote
  #4 (permalink)  
Old 05-25-2006
Registered User
 

Join Date: May 2006
Posts: 16
It worked well before

but when i try to execute the above shell script(as given by jim) it encounters the following error as 'sqlplus not found'

may be some one removed the path of sqlplus.

how should i configure the path and in which file should i configure the path

the shell type is : ksh

any mind of help is appreciated

regards
sish
Reply With Quote
  #5 (permalink)  
Old 05-25-2006
Registered User
 

Join Date: Jan 2005
Posts: 682
set up your Oracle environment first:

. /usr/local/bin/oraenv
Reply With Quote
  #6 (permalink)  
Old 05-25-2006
Registered User
 

Join Date: May 2006
Posts: 16
hey

Thanks for the earliest reply

do i need to setup it in .cshrc file?
Reply With Quote
  #7 (permalink)  
Old 05-25-2006
Registered User
 

Join Date: Jan 2005
Posts: 682
If you are using CSH then you'll want to invoke a different script:

source /usr/local/bin/coraenv

and yes, you will want to put it in your .cshrc but you'll have to set your ORACLE_SID variable and ORAENV_ASK=N prior to sourcing the script.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:49 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0