Sponsored Content
Full Discussion: perl DBI inserting date\time
Top Forums Shell Programming and Scripting perl DBI inserting date\time Post 302349264 by ilikecows on Monday 31st of August 2009 01:07:29 PM
Old 08-31-2009
If nobody here knows an easier way you could create a function that retrieves the date/time, formats it, and assigns the formatted value to a scalar and interpolate it into your statement handle assignment.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Inserting Date&Time Stamp In Existing Log File

I am trying to insert a line with a date stamp in a file that is used to monitor activity in one of our directories. By doing this, I want to grep that file each day and go to the last entry for each time a error occurred and pull all errors generated if any exist. If error exists I want that error... (3 Replies)
Discussion started by: shephardfamily
3 Replies

2. Shell Programming and Scripting

PERL DBI module install

We ran into an issue trying to install DBI and DB2 modules for perl for AIX from the link http://www-306.ibm.com/software/data/db2/perl/ We tried to install the DBI module using bash# perl -MCPAN -e 'install DBI' command. However we ended up with the following error. Stop. ... (3 Replies)
Discussion started by: jerardfjay
3 Replies

3. Programming

perl dbi to oracle getting disconnect_all for oracle dbi help

hi i am trying to connect to an oracle database using dbi and i get this :: Driver has not implemented the disconnect_all method. at /opt/perl/lib/site_perl/5.8.0/sun4-solaris/DBI.pm line 575 END failed--call queue aborted. for all i know, the script was working earlier, but has... (1 Reply)
Discussion started by: poggendroff
1 Replies

4. Shell Programming and Scripting

Installing Perl DBI and DBD

Hi, i have some queries on installing the Perl DBI and the DBD Oracle. I know that i have to install the DBI first. I have the source files in a folder in my home directory.The commands to install arecd /home/DBI Perl Makefile.PL make make installI would like to know, after executing these... (4 Replies)
Discussion started by: new2ss
4 Replies

5. Shell Programming and Scripting

connect to MySQL from Perl using DBI

Hi, I want to connect perl with the mysql to select and so on but the connection don't work code #!/usr/bin/perl BEGIN { # PERL MODULES WE WILL BE USING use DBI; $dbh = DBI->connect('DBI:mysql:C:\Program Files\MySQL\MySQL Server 5.0\data\db1','','pass') or die $DBI::errstr;} #... (1 Reply)
Discussion started by: eng_shimaa
1 Replies

6. UNIX for Advanced & Expert Users

Perl's DBI Module on OS X - uninstallable?

i've been struggling with installing the Perl DBI & DBD modules all weekend, and I'm getting close, but no cigar as of yet. When I run the perl script db.pl I get the following mismatch error: Mon Apr 19 09:43:29 EDT 2010 /Library/Perl/DBD-mysql-4.011 -> peterv@MBP17.local<515>$: db.pl | tee... (0 Replies)
Discussion started by: peterv6
0 Replies

7. Shell Programming and Scripting

perl: help with DBI

Hi there, I have a bit of code similar to below (which ive actually got from perldoc, but mine is similar enough) $sth = $dbh->prepare(q{ SELECT region, sales FROM sales_by_region }); $sth->execute; my ($region, $sales); # Bind Perl variables to columns: $rv =... (4 Replies)
Discussion started by: hcclnoodles
4 Replies

8. Shell Programming and Scripting

Date and Time in PERL

Hi, I want to get the current date and time and subtract 1 day to get to the previous day? I see timelocal( ) and (time) etc. How do I code this in PERL to get the previous day? Thanks Nurani (2 Replies)
Discussion started by: nurani
2 Replies

9. Shell Programming and Scripting

Creating a date (without time) in perl

I have a perl script that automatically runs on Mondays. I need to have it create a variable for last Monday's date thru that Sunday's date. example: 04-01-2011 thru 04-08-2011 Its reporting numbers for the previous week beginning with Monday and ending on Sunday. So i dont have to go in... (7 Replies)
Discussion started by: bbraml
7 Replies

10. Shell Programming and Scripting

Perl DBI error

Hi All, I installed DBI module in a non INC location and using it in my script via "use lib". But it throw the below error at the "use DBI" step. Please help Usage: DBI::_install_method(dbi_class, meth_name, file, attribs=Nullsv) at /xx/xxx/xxxxx/xxxxx/oracle/lib/DBI.pm/oracle/lib/DBI.pm line... (2 Replies)
Discussion started by: prasperl
2 Replies
DateTime::Format::ICal(3pm)				User Contributed Perl Documentation			       DateTime::Format::ICal(3pm)

NAME
DateTime::Format::ICal - Parse and format iCal datetime and duration strings SYNOPSIS
use DateTime::Format::ICal; my $dt = DateTime::Format::ICal->parse_datetime( '20030117T032900Z' ); my $dur = DateTime::Format::ICal->parse_duration( '+P3WT4H55S' ); # 20030117T032900Z DateTime::Format::ICal->format_datetime($dt); # +P3WT4H55S DateTime::Format::ICal->format_duration($dur); DESCRIPTION
This module understands the ICal date/time and duration formats, as defined in RFC 2445. It can be used to parse these formats in order to create the appropriate objects. METHODS
This class offers the following methods. o parse_datetime($string) Given an iCal datetime string, this method will return a new "DateTime" object. If given an improperly formatted string, this method may die. o parse_duration($string) Given an iCal duration string, this method will return a new "DateTime::Duration" object. If given an improperly formatted string, this method may die. o parse_period($string) Given an iCal period string, this method will return a new "DateTime::Span" object. If given an improperly formatted string, this method may die. o parse_recurrence( recurrence => $string, ... ) Given an iCal recurrence description, this method uses "DateTime::Event::ICal" to create a "DateTime::Set" object representing that recurrence. Any parameters given to this method beside "recurrence" will be passed directly to the "DateTime::Event::ICal->recur" method. If given an improperly formatted string, this method may die. This method accepts optional parameters "dtstart" and "dtend". These parameters must be "DateTime" objects. The iCal spec requires that "dtstart" always be included in the recurrence set, unless this is an "exrule" statement. Since we don't know what kind of statement is being parsed, we do not include "dtstart" in the recurrence set. o format_datetime($datetime) Given a "DateTime" object, this methods returns an iCal datetime string. The iCal spec requires that datetimes be formatted either as floating times (no time zone), UTC (with a 'Z' suffix) or with a time zone id at the beginning ('TZID=America/Chicago;...'). If this method is asked to format a "DateTime" object that has an offset-only time zone, then the object will be converted to the UTC time zone internally before formatting. For example, this code: my $dt = DateTime->new( year => 1900, hour => 15, time_zone => '-0100' ); print $ical->format_datetime($dt); will print the string "19000101T160000Z". o format_duration($duration) Given a "DateTime::Duration" object, this methods returns an iCal duration string. The iCal standard does not allow for months or years in a duration, so if a duration for which "delta_months()" is not zero is given, then this method will die. o format_period($span) Given a "DateTime::Span" object, this methods returns an iCal period string, using the format "DateTime/DateTime". o format_period_with_duration($span) Given a "DateTime::Span" object, this methods returns an iCal period string, using the format "DateTime/Duration". o format_recurrence($arg [,$arg...] ) This method returns a list of strings containing ICal statements. In scalar context it returns a single string which may contain embedded newlines. The argument can be a "DateTime" list, a "DateTime::Span" list, a "DateTime::Set", or a "DateTime::SpanSet". ICal "DATE" values are not supported. Whenever a date value is found, a "DATE-TIME" is generated. If a recurrence has an associated "DTSTART" or "DTEND", those values must be formatted using "format_datetime()". The "format_recurrence()" method will not do this for you. If a "union" or "complement" of recurrences is being formatted, they are assumed to have the same "DTSTART" value. Only "union" and "complement" operations are supported for recurrences. This is a limitation of the ICal specification. If given a set it cannot format, this method may die. Only "DateTime::Set::ICal" objects are formattable. A set may change class after some set operations: $recurrence = $recurrence->union( $dt_set ); # Ok - $recurrence still is a DT::Set::ICal $recurrence = $dt_set->union( $recurrence ); # Not Ok! - $recurrence is a DT::Set now The only unbounded recurrences currently supported are the ones generated by the "DateTime::Event::ICal" module. You can add ICal formatting support to a custom recurrence by using the "DateTime::Set::ICal" module: $custom_recurrence = DateTime::Set::ICal->from_recurrence ( recurrence => sub { $_[0]->truncate( to => 'month' )->add( months => 1 ) } ); $custom_recurrence->set_ical( include => [ 'FREQ=MONTHLY' ] ); SUPPORT
Support for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details. AUTHORS
Dave Rolsky <autarch@urth.org> and Flavio Soibelmann Glock <fglock@pucrs.br> Some of the code in this module comes from Rich Bowen's "Date::ICal" module. COPYRIGHT
Copyright (c) 2003 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. SEE ALSO
datetime@perl.org mailing list http://datetime.perl.org/ perl v5.10.0 2009-05-24 DateTime::Format::ICal(3pm)
All times are GMT -4. The time now is 07:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy