The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Error connecting oracle from inside while loop Devesh5683 Shell Programming and Scripting 3 05-13-2008 03:48 AM
Ps -ef | grep oracle question vishalpatel03 Shell Programming and Scripting 5 02-28-2008 03:09 PM
ORACLE RAC ASM disk question Eronysis Red Hat 5 02-18-2008 01:50 PM
while loop question stepnkev Shell Programming and Scripting 2 06-01-2007 10:51 AM
Loop question strike Shell Programming and Scripting 18 04-13-2005 11:24 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 09-28-2006
pavan_test pavan_test is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 53
oracle and loop question

Hi All,

I have a 2 questions; 1 is oracle and another is korn shell

say TIME=20060928
desired output: 20060927

say TIME=20061001
DESIRED output: 20060930

If i substract one day from 'TIME' i am looking for previous day.

can anyone please suggest me how do i do this is SQL.

i have another question; i am trying to write this is korn shell

KKK=a,b,c,d,e

if [ $KKK == 'a' or $KKK == 'c' or $kkk == 'e' ]; then
echo " i am here
else
echo " i am out"
fi

the above code that i wrote is not working.

can anyone please suggest me

thanks
mark
  #2 (permalink)  
Old 09-28-2006
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,122
Code:
#!/bin/ksh

KKK='a,b,c,d,e'

if [[ "${KKK}" = @(*a*|*b*) ]] ; then
   echo "[$KKK] IS [a,b]"
else
   echo "[$KKK] NOT [a,b]"
fi;
  #3 (permalink)  
Old 09-28-2006
pavan_test pavan_test is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 53
Date conversion

Thanks a bunch

can anyone also please suggest me for the following

this is oracle question

say TIME=20060928
desired output: 20060927

say TIME=20061001
DESIRED output: 20060930

If i substract one day from 'TIME' i am looking for previous day.

can anyone please suggest me how do i do this is SQL.

thanks
mark
  #4 (permalink)  
Old 09-29-2006
pavan_test pavan_test is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 53
Date conversion

Hi All,

thanks to all of you for your suggestions;
this is how I tried

SQL> select to_date('20060928', 'YYYYMMDD') - 1 from dual;

TO_DATE('
---------
27-SEP-06

my desired output in this case is 20060927 but here the output is
coming as 27-SEP-06.

can anyone please suggest me how do I get the output as 20060927


thanks a bunch
mark
  #5 (permalink)  
Old 09-29-2006
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
Code:
select to_char(to_date('20060928', 'YYYYMMDD') - 1 ,'YYYYMMDD')  from dual;

Last edited by anbu23; 09-29-2006 at 12:33 AM..
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:56 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