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
Hi Can any one help me out from this Iam new to shell scripting kreddy2003 Shell Programming and Scripting 0 05-27-2008 11:54 PM
need some help on shell scripting.. hilofat Shell Programming and Scripting 6 02-03-2008 08:23 AM
Help need in Shell Scripting raghav1982 Shell Programming and Scripting 11 12-04-2007 02:05 AM
Shell scripting and SQL sendhilmani123 Shell Programming and Scripting 5 04-22-2006 06:06 AM
difference between AIX shell scripting and Unix shell scripting. haroonec Shell Programming and Scripting 2 04-12-2006 05:12 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-20-2008
Registered User
 

Join Date: Mar 2008
Posts: 14
Question how towrite sql in shell scripting

hi
iam new of scipiting.give me the some Material of regarding sql in scripting.
and i have no backup's in 3 severs.how to write script in dirctory.
please give me some usefull information





cheers
Naveen.g
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-20-2008
Registered User
 

Join Date: Aug 2007
Posts: 40
Example code

Here is sm example code that you can use accordingly.

Code:
  diffdays=`sqlplus -s <username>/<password> <<END
  set pagesize 0
  set feedback off
  set heading off
  set echo off
  set verify off
  select to_date($sysdate, 'yyyymmdd') - to_date($currfile, 'yyyymmdd')   from dual;
diffdays will be having the output of the query in this case
Reply With Quote
  #3 (permalink)  
Old 03-20-2008
Registered User
 

Join Date: Mar 2008
Posts: 34
Just make sure you note the heredoc in the example ... and that you make sure to close it:

Code:
  diffdays=`sqlplus -s <username>/<password> <<END
  set pagesize 0
  set feedback off
  set heading off
  set echo off
  set verify off
  select to_date($sysdate, 'yyyymmdd') - to_date($currfile, 'yyyymmdd')   from dual;
Code:
END `
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:29 AM.


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