🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
4 messages
4 total messages Started by crhras Fri, 18 Aug 2006 02:21
E_FAIL with NOT NULL datetime
#344
Author: crhras
Date: Fri, 18 Aug 2006 02:21
32 lines
1670 bytes
Can someone please explain why the following occurs ?

The first table gives E_FAIL whenever the table is opened and at least one 
record is "000-00-00 00:00:00".  The second table works just fine.  The 
second table is exactly the same as the first except DTime is declared as 
NOT NULL.

--
-- broken table
--
CREATE TABLE  tt (
  serial            int(10) unsigned NOT NULL auto_increment,
  DTime         datetime NOT NULL default '0000-00-00 00:00:00',
  val               int,
  PRIMARY KEY (serial)
)
;

--
-- good table
--
CREATE TABLE  tt (
  serial            int(10) unsigned NOT NULL auto_increment,
  DTime         datetime default '0000-00-00 00:00:00',
  val               int,
  PRIMARY KEY (serial)
)
;

Thank you,
Curt
Re: E_FAIL with NOT NULL datetime
#345
Author: Mark Guerrieri
Date: Fri, 18 Aug 2006 14:28
41 lines
1983 bytes
What is the back-end database?  Some ODBC drivers (I believe MySQL is among 
them) have trouble with NULL date values.

Mark

"crhras" <crhras@sbcglobal.net> wrote in message 
news:44e52431$1@newsgroups.borland.com...
>
> Can someone please explain why the following occurs ?
>
> The first table gives E_FAIL whenever the table is opened and at least one 
> record is "000-00-00 00:00:00".  The second table works just fine.  The 
> second table is exactly the same as the first except DTime is declared as 
> NOT NULL.
>
> --
> -- broken table
> --
> CREATE TABLE  tt (
>  serial            int(10) unsigned NOT NULL auto_increment,
>  DTime         datetime NOT NULL default '0000-00-00 00:00:00',
>  val               int,
>  PRIMARY KEY (serial)
> )
> ;
>
> --
> -- good table
> --
> CREATE TABLE  tt (
>  serial            int(10) unsigned NOT NULL auto_increment,
>  DTime         datetime default '0000-00-00 00:00:00',
>  val               int,
>  PRIMARY KEY (serial)
> )
> ;
>
> Thank you,
> Curt
>
> 
Re: E_FAIL with NOT NULL datetime
#346
Author: crhras
Date: Fri, 18 Aug 2006 17:12
49 lines
2244 bytes
Ugh, sorry I didn't post that originally ---- it is MySQL.



"Mark Guerrieri" <mguerrieri@no_spam_verizon.net> wrote in message 
news:44e5ce8e@newsgroups.borland.com...
> What is the back-end database?  Some ODBC drivers (I believe MySQL is 
> among them) have trouble with NULL date values.
>
> Mark
>
> "crhras" <crhras@sbcglobal.net> wrote in message 
> news:44e52431$1@newsgroups.borland.com...
>>
>> Can someone please explain why the following occurs ?
>>
>> The first table gives E_FAIL whenever the table is opened and at least 
>> one record is "000-00-00 00:00:00".  The second table works just fine. 
>> The second table is exactly the same as the first except DTime is 
>> declared as NOT NULL.
>>
>> --
>> -- broken table
>> --
>> CREATE TABLE  tt (
>>  serial            int(10) unsigned NOT NULL auto_increment,
>>  DTime         datetime NOT NULL default '0000-00-00 00:00:00',
>>  val               int,
>>  PRIMARY KEY (serial)
>> )
>> ;
>>
>> --
>> -- good table
>> --
>> CREATE TABLE  tt (
>>  serial            int(10) unsigned NOT NULL auto_increment,
>>  DTime         datetime default '0000-00-00 00:00:00',
>>  val               int,
>>  PRIMARY KEY (serial)
>> )
>> ;
>>
>> Thank you,
>> Curt
>>
>>
>
> 
Re: E_FAIL with NOT NULL datetime
#347
Author: crhras
Date: Fri, 18 Aug 2006 17:12
51 lines
2188 bytes
I should probably post this in a MySQL group, huh ?  Thanks for your 
response, BTW.



"Mark Guerrieri" <mguerrieri@no_spam_verizon.net> wrote in message 
news:44e5ce8e@newsgroups.borland.com...
> What is the back-end database?  Some ODBC drivers (I believe MySQL is 
> among them) have trouble with NULL date values.
>
> Mark
>
> "crhras" <crhras@sbcglobal.net> wrote in message 
> news:44e52431$1@newsgroups.borland.com...
>>
>> Can someone please explain why the following occurs ?
>>
>> The first table gives E_FAIL whenever the table is opened and at least 
>> one record is "000-00-00 00:00:00".  The second table works just fine. 
>> The second table is exactly the same as the first except DTime is 
>> declared as NOT NULL.
>>
>> --
>> -- broken table
>> --
>> CREATE TABLE  tt (
>>  serial            int(10) unsigned NOT NULL auto_increment,
>>  DTime         datetime NOT NULL default '0000-00-00 00:00:00',
>>  val               int,
>>  PRIMARY KEY (serial)
>> )
>> ;
>>
>> --
>> -- good table
>> --
>> CREATE TABLE  tt (
>>  serial            int(10) unsigned NOT NULL auto_increment,
>>  DTime         datetime default '0000-00-00 00:00:00',
>>  val               int,
>>  PRIMARY KEY (serial)
>> )
>> ;
>>
>> Thank you,
>> Curt
>>
>>
>
> 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads