[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql
Subject:    Re: MySQL NULL value in DBI (was:  Do you believe in ghosts ???)
From:       Van <vanboers () server ! dedserius ! com>
Date:       1999-07-28 12:05:10
[Download RAW message or body]

"Christos J. Pontikis" wrote:
> 
> Hello, Van, thank you for your help
> 
> I sent you the file y2kmatrix.out.gz
> 
> Christos
> http://www.medisign.gr
> 
> >"Christos J. Pontikis" wrote:
> >>
> >> Hello, Van, thank you for your reply.
> >>
> >> I send you the information you ask for.
> >> P.S.  I agree with you about...ghosts..!
> >>
> >> #------------------------------------------------------------------------------
> >> Red Hat Linux release 5.2 (Apollo)
> >> Kernel 2.0.36 on an i586
> >>
> >> [root@cosmos /root]# gcc --version
> >> 2.7.2.3
> >>
> >> mysql  Ver 9.15 Distrib 3.21.30, for pc-linux-gnu (i586)
> >>
> >> This is perl, version 5.004_04 built for i386-linux
> >>
> >> #------------------------------------------------------------------------------
> >> sub currentdate_ts {
> >>  # get local time
> >>  @dt=localtime();
> >>
> >>  $dt[5]+=1900;   $cyear=$dt[5];
> >>  $dt[4]+=1;   $cmonth =$dt[4];   if($cmonth<10) {$cmonth="0$cmonth";}
> >>  $cday=$dt[3];   if($cday<10) {$cday="0$cday";}
> >>  $chour=$dt[2];  if($chour<10) {$cday="0$chour";}
> >>  $cmin=$dt[1];  if($cmin<10) {$cmin="0$cmin";}
> >>  $csec=$dt[0];  if($csec<10) {$csec="0$csec";}
> >>  $current_date_ts="$cyear$cmonth$cday$chour$cmin$csec";
> >>  return $current_date_ts;
> >> }
> >>
> >> #------------------------------------------------------------------------------
> >>
> >> Regards
> >>
> >> Christos
Christos,
I've taken a look at the file, and, all seems well, with the exception
of the 1st line, but, that could be explained by Time Zone.  Might want
to double-check on that (I'm in -0400 GMT), but, I wouldn't dwell on it.
Yours=
1969-12-31 23:59:59 365 PM. [Wednesday, December 31, 1969]
1901-12-14 14:11:00 348 PM. [Saturday, December 14, 1901]
1901-12-15 14:11:00 349 PM. [Sunday, December 15, 1901]
Mine=
1901-12-13 21:18:03 347 PM. [Friday, December 13, 1901]
1901-12-14 21:18:03 348 PM. [Saturday, December 14, 1901]
1901-12-15 21:18:03 349 PM. [Sunday, December 15, 1901] 

My guess is that in your setting of $current_date_ts, the value went to
NULL for some reason, perhaps in the logic of your if statements.  Check
your mysql.log for that entry (if you have it), or use the value it put
into the insert field. to test out your perl script to see what the
value returns.  
Hope that helps.
Van
-- 
=========================================================================
Linux rocks!!!   http://www.dedserius.com
=========================================================================

---------------------------------------------------------------------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail mysql-thread8615@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail mysql-unsubscribe@lists.mysql.com instead.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic