[Gambas-user] Re; MySQL "timestamp"

Gareth Bult gareth at ...1689...
Tue Jul 17 16:10:13 CEST 2007


Hi,

Here goes .. (it's pretty basic)

-- MySQL dump 10.11
--
-- Host: localhost    Database: axis
-- ------------------------------------------------------
-- Server version       5.0.38-Ubuntu_0ubuntu1-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `cache`
--

DROP TABLE IF EXISTS `cache`;
CREATE TABLE `cache` (
  `id` int(11) NOT NULL,
  `camera` tinyint(1) NOT NULL,
  `stamp` timestamp NULL default NULL,
  `event` enum('End','Start') default NULL,
  `image` mediumblob,
  KEY `event` (`event`)
) ENGINE=MyISAM AUTO_INCREMENT=712 DEFAULT CHARSET=latin1;

---- Table structure for table `frames`
--
DROP TABLE IF EXISTS `frames`;
CREATE TABLE `frames` (  `id` int(11) NOT NULL auto_increment,  `camera` tinyint(1) NOT NULL,  `stamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,  `event` enum('End','Start') default NULL,  `image` mediumblob,  PRIMARY KEY  (`id`),  KEY `event` (`event`)) ENGINE=MyISAM AUTO_INCREMENT=712 DEFAULT CHARSET=latin1;

---- Dumping data for table `frames`        
--LOCK TABLES `frames` WRITE;
/*!40000 ALTER TABLE `frames` DISABLE KEYS */;
INSERT INTO `frames` VALUES (1,0,'2007-07-16 16:55:40',NULL,NULL)
/*!40000 ALTER TABLE `frames` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2007-07-17 14:04:45

--
Gareth Bult, Encryptec Limited
Tel: 0845 25 77033, Mob: 07891 389657
Email: gareth at ...1689... 
Statements made are at all times subject to Encryptec's Terms and Conditions of Business, which are available upon request.

----- Original Message -----
From: "Benoit Minisini" <gambas at ...1...>
To: "mailing list for gambas users" <gambas-user at lists.sourceforge.net>
Sent: Tuesday, July 17, 2007 2:36:20 PM (GMT) Europe/London
Subject: Re: [Gambas-user] Re; MySQL "timestamp"

On mardi 17 juillet 2007, Gareth Bult wrote:
> Hi,
>
> Is there a trick to using a MySQL "timestamp" field from inside Gambas ?
>
> It seems to recognise a timestamp as a date type, but reads it looks
> totally corrupt.
>
> Using;
> $resultSet = connection.Exec("SELECT id,camera,event,image,stamp FROM cache
> WHERE id = &1",id)
>
> In the debugger I see (for example);
>
> $resultSet!stamp gives 01/01/-4801 -276:-2:-37
> (as opposed to 16-07-2007 17:55:40)
>
> .. "Date" fields seem to work fine ..
>
> ??
>
> tia
> Gareth.

According to the source code, the "timestamp" are managed, as the other 
date/time MySQL datatypes. 

Can you send me your database, or at least the table with just the offending 
record, in SQL text dump format?

Thanks in advance.

-- 
Benoit Minisini

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Gambas-user mailing list
Gambas-user at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user





More information about the User mailing list