Sponsored Content
Top Forums Shell Programming and Scripting How to put date range from a perl & sql script Post 302543660 by DGPickett on Monday 1st of August 2011 04:00:07 PM
Old 08-01-2011
I am guessing, as I have not used oracle perl, that you need to explicitly concatenate, like '||' or '+'.

Between is not your friend, since it gets both end points. In dodging this, you added code, and in return, you might miss something between 235959 and 000000, if timestamps have factions. It snares the unwary all the time. Nobody has the guts to do "dt between a and b and dt != b" !

Time goes to zero by default.

Decide which end point is included and which is not. Usually one keeps the first instant of the day with the day, so:
Code:
and c.at >= to_date( ${date}, 'yyyymmdd' )
and c.at < ( 7 + to_date( ${date}, 'yyyymmdd' ) )

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

perl script dies altogether when I put an & after it

ignore (2 Replies)
Discussion started by: hairytorus
2 Replies

2. Shell Programming and Scripting

Perl code to extract data from the range of date

Hi All, I'm still a newbie in perl programming. I have a data below say in test.tmp The output in test.tmp will be the same data as above sample in test.tmp . So after i get all the 4th column data within the range of month and year i need, then i will use the foreach () code to execute... (1 Reply)
Discussion started by: miskin
1 Replies

3. Shell Programming and Scripting

grep - date & time range

Hi, I need to search email files by date & time range in email files. The timezone is not important. Can someone plz advise how i can do this ? For e.g A user can specify only A single date A date range date & time range Below is part of the email file. (4 Replies)
Discussion started by: coolatt
4 Replies

4. Programming

How to put variable date from SQL Script

Hi Guys, Can someone please help me on adding/inserting a variable to an sql scipt? Basically I want to assign today's date. As shown below.. set head off; set linesize 300; set pagesize 200; spool /opt/oracle/temp/output.txt select value,count(*) as totalcount from pmowner.pinpebasev... (11 Replies)
Discussion started by: pinpe
11 Replies

5. Shell Programming and Scripting

Script on Date Range

Hi All, Can anybody help me out a Shell script which pulls the files based on date range Example ./test.sh start_date End_date (20110901 20110930) or ./test.sh ( if we don't provide any input) it should take sysdate-1 ( yesterdays date) it should have both conditions Plzz help me... (1 Reply)
Discussion started by: krux_rap
1 Replies

6. UNIX Desktop Questions & Answers

grep a range of time & date

how can i grep a range? i have a text file with the following text: result.log.00:2012/01/02 12:00:07.422 LOG STARTED HERE N6Kashya29MemoryShieldScheduler_AO_IMPLE, pid=8662/8658, config=(alertThreshold=10,alertLevel=0,killThreshold=7200,coreThreshold=0,full=1), deltaTime=0,... (1 Reply)
Discussion started by: boaz733
1 Replies

7. Shell Programming and Scripting

run script in time and date range

i need to run one script inside of other, and there is some terms - main script in scheduled in cron for everyday runing every 5min - i need to run /tmp/script2.sh after first 3 days in month - i need to run /tmp/script2.sh from 7-9AM, main script is runining all day all recommendations are... (1 Reply)
Discussion started by: waso
1 Replies

8. Shell Programming and Scripting

PERL, Date & Time issues

Hello All, This is my first script in PERL. Hence require your help in moving further. I have a script which should populate the values for Today, Yesterday output. For which I use timeFrame as a variable to obtain the time in hrs:mm as 10:00. All I want is, I want my timeFrame to start... (4 Replies)
Discussion started by: sathyaonnuix
4 Replies

9. Shell Programming and Scripting

Perl script to allocate next available IP from a range

Hi I am looking to automate the process in PERL of allocating IP addresses from a set range of addresses (for example a /22 network 10.10.224.1 - 10.10.227.254) I am able to query the IP addresses that are already in use in the above range, which will produce me a list like this for example... (3 Replies)
Discussion started by: hcclnoodles
3 Replies

10. UNIX for Advanced & Expert Users

To pass one month range in sql script

Hi Guys, i am having .sql script which inserts data from one table to another table based on date condition, i need to pass range on based on how many number of months, for e.g set timing on; whenever sqlerror exit failure; spool myscript.log append accept start_date... (7 Replies)
Discussion started by: rohit_shinez
7 Replies
TZ(5)								File Formats Manual							     TZ(5)

NAME
TZ - Time zone environment variable SYNOPSIS
TZ=zone[-]offset[dst[offset][,start[/time],end[/time]]] DESCRIPTION
The TZ environment variable tells functions such as the ctime(3) family and programs like date what the time zone and daylight saving rule is. The value of TZ has the POSIX standardized form shown in the synopsis. This form specifies the zone names, offsets from GMT, and day- light savings changeover times for at least the current year. zone A three or more letter name for the time zone in normal (winter) time. [-]offset A signed time telling the offset of the time zone westwards from Greenwich. The time has the form hh[:mm[:ss]] with a one of two digit hour, and optional two digit minutes and seconds. dst The name of the time zone when daylight savings is in effect. It may be followed by an offset telling how big the clock correction is other than the default of 1 hour. start/time,end/time Specifies the start and end of the daylight savings period. The start and end fields indicate on what day the changeover occurs. They must be in one of the following formats: Jn The Julian day n (1 <= n <= 365) ignoring leap days, i.e. there is no February 29. n The zero-based Julian day (0 <= n <= 365). Leap days are not ignored. Mm.n.d This indicates month m, the n-th occurrence of day d (1 <= m <= 12, 1 <= n <= 5, 0 <= d <= 6, 0=Sunday). The 5-th occurrence means the last occurrence of that day in a month. So M4.1.0 is the first Sunday in April, M9.5.0 is the last Sunday in Septem- ber. The time field indicates the time the changeover occurs on the given day. EXAMPLES
Greenwich Mean Time: TZ=GMT0 Middle European Time, 1 hour east from Greenwich, daylight savings starts on the last Sunday in March at 2 AM and ends on the last Sunday in October at 3 AM: TZ='MET-1MET DST,M3.5.0/2,M10.5.0/3' British time, daylight savings starts and ends at the same moment as MET, but in an earlier time zone: TZ=GMT0BST,M3.5.0/1,M10.5.0/2 The eastern european time zones also have the changeovers at the same absolute time as British time and MET. U.S. Eastern Standard Time, 5 hours west from Greenwich, daylight savings starts on the first Sunday in April at 2 AM and ends on the last Sunday in October at 2 AM: TZ=EST5EDT,M4.1.0/2,M10.5.0/2 It shouldn't surprise you that daylight savings in New Zealand is observed in the months opposite from the previous examples. It starts on the first Sunday in October at 2 AM and ends on the third Sunday in March at 3 AM: TZ=NZST-12NZDT,M10.1.0/2,M3.3.0/3 SEE ALSO
readclock(8), date(1). BUGS
You may have noticed that many fields are optional. Do no omit them, because the defaults are bogus. If you need daylight savings then fully specify the changeovers. West is negative, east is positive, ask any sailor. AUTHOR
Kees J. Bot (kjb@cs.vu.nl) TZ(5)
All times are GMT -4. The time now is 11:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy