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 > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Connecting to oracle database from shell script satyakiran Shell Programming and Scripting 8 07-03-2009 03:22 PM
Connecting to sybase via shell script. arvindcgi Shell Programming and Scripting 1 05-20-2008 10:30 AM
C Shell Script query bpupdown Shell Programming and Scripting 1 05-13-2008 07:38 PM
error connecting sql through a shell script nehak Shell Programming and Scripting 1 04-30-2008 08:04 AM
Executing Sql Query Using Shell Script ragha81 Shell Programming and Scripting 14 07-31-2006 02:15 PM

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 03-27-2003
mehuldoshi mehuldoshi is offline
Registered User
  
 

Join Date: Jan 2002
Location: COCHIN city INDIA.
Posts: 5
Question Connecting DB in the Shell Script to do SQL Query

Any link or example to write shell script for the Connecting Oracle for Quering through SQL

thanks in advance ...

Cheers !!
Mehul Doshi
  #2 (permalink)  
Old 03-27-2003
s93366's Avatar
s93366 s93366 is offline
Registered User
  
 

Join Date: Apr 2002
Location: Sweden / Stockholm
Posts: 168
with sqlplus for oracle you can do:

shell>sqlplus username/password @filename_with_sql.sql


where filename_with_sql.sql looks like this for example:
------------------------------------------
select * from v$database;
quit
-------------------------------------------

/Peter
  #3 (permalink)  
Old 03-27-2003
edog edog is offline
Registered User
  
 

Join Date: Sep 2001
Location: Green Bay, WI
Posts: 66
here is another way:

horiz=`sqlplus -s scott/tiger@test_db <<END
set pagesize 0
set feedback off
set heading off
set echo off
set verify off
select sysdate from dual;
exit;
END`
  #4 (permalink)  
Old 03-29-2003
mehuldoshi mehuldoshi is offline
Registered User
  
 

Join Date: Jan 2002
Location: COCHIN city INDIA.
Posts: 5
thanks for the help.

I would try this out and get back to you in case any more help or clarification required.


Cheers !!
Mehul Doshi
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 04:17 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