The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
C Shell Script query bpupdown Shell Programming and Scripting 1 05-13-2008 07:38 PM
Need Unix script for executing oracle query ravi gongati Shell Programming and Scripting 14 03-24-2008 05:53 AM
Script executing sql query kingluke Shell Programming and Scripting 2 01-23-2008 01:57 PM
executing a SQL query in shell script lijju.mathew Shell Programming and Scripting 1 05-17-2007 11:29 AM
Executing a SQL query from a shell script 98_1LE UNIX for Dummies Questions & Answers 3 03-23-2002 03:29 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
  #1 (permalink)  
Old 07-27-2006
ragha81 ragha81 is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 145
Executing Sql Query Using Shell Script

HI ALL
i have a requirement like this. i have to write a shell script to run a sql query. DB is oracle. once the query is run, the results of the query has to be published in a data file. can you please advice me how to go about it. i am absolutely new to shell scripts and this is a part of my job.
  #2 (permalink)  
Old 07-27-2006
tmarikle tmarikle is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2005
Posts: 683
This question is answered several times a week; please search the forums.
  #3 (permalink)  
Old 07-27-2006
ragha81 ragha81 is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 145
thanks for the reply, i am new to this group and I will look for the posts
  #4 (permalink)  
Old 07-27-2006
tmarikle tmarikle is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2005
Posts: 683
This post may get you started.
  #5 (permalink)  
Old 07-28-2006
chittari chittari is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 10
try this

DATA=`echo "SET HEADING OFF;\n SET FEED OFF;\n select <whatever query you want here > ;\n exit\n"|sqlplus -s /`

echo $DATA > <whatver file you want>
  #6 (permalink)  
Old 07-28-2006
ragha81 ragha81 is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 145
hi

i tried your query. when i execute that i am getting an error like this "SQL plus cant be found" is there a way not to mention the user name and pwd in the script. thanks
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0