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
Need Unix script for executing oracle query ravi gongati Shell Programming and Scripting 14 03-24-2008 02:53 AM
Print out loop index on the console after executing each sybase DB query Alaeddin Shell Programming and Scripting 2 12-16-2007 01:30 AM
executing a SQL query in shell script lijju.mathew Shell Programming and Scripting 1 05-17-2007 08:29 AM
Executing Sql Query Using Shell Script ragha81 Shell Programming and Scripting 14 07-31-2006 11:15 AM
Executing a SQL query from a shell script 98_1LE UNIX for Dummies Questions & Answers 3 03-23-2002 12:29 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-22-2008
Registered User
 

Join Date: Jan 2008
Posts: 2
Script executing sql query

Hello,

I have a sh script excuting a sql query through sqlplus. I am having trouble making my date equal to the date of the server time in the sql script. How can i call the server date from my query?

Thanks
Reply With Quote
Forum Sponsor
  #2  
Old 01-22-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
I'm not understanding the problem. You want to get the time/date on the server then use it in your query? Just use the variable "SYSDATE" in your query, it is the current time on the server. example:
Code:
SELECT STUFF FROM MYTABLE WHERE TABLE_DATE > SYSDATE -1;
-- finds all of the rows in mytable where the table_date field has a value that is less than one day.
Reply With Quote
  #3  
Old 01-23-2008
Registered User
 

Join Date: Jan 2008
Posts: 2
Thanks for your help! It works!!

Last edited by kingluke; 01-23-2008 at 11:29 AM. Reason: figured it out!
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:32 AM.


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

Content Relevant URLs by vBSEO 3.2.0