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
Need Unix script for executing oracle query ravi gongati Shell Programming and Scripting 14 03-24-2008 05:53 AM
Print out loop index on the console after executing each sybase DB query Alaeddin Shell Programming and Scripting 2 12-16-2007 04:30 AM
executing a SQL query in shell script lijju.mathew Shell Programming and Scripting 1 05-17-2007 11:29 AM
Executing Sql Query Using Shell Script ragha81 Shell Programming and Scripting 14 07-31-2006 02:15 PM
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 Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-22-2008
kingluke kingluke is offline
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
  #2 (permalink)  
Old 01-22-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,748
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.
  #3 (permalink)  
Old 01-23-2008
kingluke kingluke is offline
Registered User
  
 

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

Last edited by kingluke; 01-23-2008 at 02:29 PM.. Reason: figured it out!
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 02:31 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