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
retrieve value from a file satish@123 Shell Programming and Scripting 1 05-17-2008 07:40 AM
display the result of wc -l with words before and after the result melanie_pfefer UNIX for Dummies Questions & Answers 3 04-30-2008 07:33 AM
To retrieve Date/Time from Windows by unix/linux boxes mpc8250 Shell Programming and Scripting 4 02-09-2008 12:31 AM
Outputting formatted Result log file from old 30000 lines result log<help required> vikas.iet Shell Programming and Scripting 5 12-02-2007 10:43 PM
how do we retrieve a line from a file in unix lmadhuri Shell Programming and Scripting 2 02-07-2007 08:07 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-07-2007
happyv happyv is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 209
how to retrieve sql result to unix....

Hi,

i would like to retrieve seql result and write it into unix text file like "result.txt"

In unix, normally, I type "sql" and get into sql,then type "select....." to run and get the result....then copy and paste into result.txt

any possible way to write a script to run it automatically?

Thanks all!!!!
  #2 (permalink)  
Old 02-07-2007
happyv happyv is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 209
no one can help????????????????????
  #3 (permalink)  
Old 02-07-2007
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
SEarch the forums. This question is asked almost every day.

Search on the word 'oracle'.
  #4 (permalink)  
Old 02-08-2007
sumeet sumeet is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 31
depends on what database you are using

I am using DB2

so once you connect to db2 run the following on unix prompt:

db2 -tvf query.file -z result.file

I dont remeber how to implement it on Oracle. But as far I can recollect:

sqlplus -s @username/password < $sql_file.sql > $sql_file.log

thanks
Sumeet
Sponsored Links
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 06:29 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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