Unix Technical Forum

Setting null to date field from Delphi.

This is a discussion on Setting null to date field from Delphi. within the pgsql Interfaces odbc forums, part of the PostgreSQL category; --> I am working with Delphi 2006 and pgsql-odbc driver 8.02.02.00 to 8.02.04.00. I am trying to set a date ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces odbc

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 05:18 PM
Terry Yapt
 
Posts: n/a
Default Setting null to date field from Delphi.

I am working with Delphi 2006 and pgsql-odbc driver 8.02.02.00 to
8.02.04.00.

I am trying to set a date field to null. In spite of the boolean value
of 'Dataset.FieldByName('datefield').isnull' is returning true
(onBeforePost event), PostgreSQL is complaining with error: 22008 and
showing the date: '0001-00-00' as the wrong date value.

If someone have any idea it would be very appreciated.

Thanks.

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 05:18 PM
Miguel Juan
 
Posts: n/a
Default Re: Setting null to date field from Delphi.

Hi,

have a look to the class TParam: TParam.Clear ,TParam.Bound and ftDate

Regards

Miguel Juan
----- Original Message -----
From: "Terry Yapt" <yapt@technovell.com>
To: <pgsql-odbc@postgresql.org>
Sent: Wednesday, May 02, 2007 12:16 PM
Subject: [ODBC] Setting null to date field from Delphi.


>I am working with Delphi 2006 and pgsql-odbc driver 8.02.02.00 to
> 8.02.04.00.
>
> I am trying to set a date field to null. In spite of the boolean value
> of 'Dataset.FieldByName('datefield').isnull' is returning true
> (onBeforePost event), PostgreSQL is complaining with error: 22008 and
> showing the date: '0001-00-00' as the wrong date value.
>
> If someone have any idea it would be very appreciated.
>
> Thanks.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>




---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 05:19 PM
Terry Yapt
 
Posts: n/a
Default Re: Setting null to date field from Delphi.

Thanks but I am working with TDataSets.

As I said:
Dataset.FieldByName('datefield').isnull is returning TRUE but when I do
a post to Database then PostgreSQL complaint with error: 22008.

Any another idea ?

Thanks...


"Miguel Juan" wrote:

> Hi,
>
> have a look to the class TParam: TParam.Clear ,TParam.Bound and
> ftDate
>
> Regards
>
> Miguel Juan
> ----- Original Message ----- From: "Terry Yapt" <yapt@technovell.com>
> To: <pgsql-odbc@postgresql.org>
> Sent: Wednesday, May 02, 2007 12:16 PM
> Subject: [ODBC] Setting null to date field from Delphi.
>
>
> > I am working with Delphi 2006 and pgsql-odbc driver 8.02.02.00 to
> > 8.02.04.00.
> >
> > I am trying to set a date field to null. In spite of the boolean
> > value of 'Dataset.FieldByName('datefield').isnull' is returning
> > true (onBeforePost event), PostgreSQL is complaining with error:
> > 22008 and showing the date: '0001-00-00' as the wrong date value.
> >
> > If someone have any idea it would be very appreciated.
> >
> > Thanks.
> >
> > ---------------------------(end of
> > broadcast)--------------------------- TIP 6: explain analyze is
> > your friend
> >

>
>
>
> ---------------------------(end of
> broadcast)--------------------------- TIP 6: explain analyze is your
> friend




--

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-17-2008, 05:19 PM
Terry Yapt
 
Posts: n/a
Default Re: Setting null to date field from Delphi.

Thanks but I am working with TDataSets not a TQuery.

As I said:
Dataset.FieldByName('datefield').isnull is returning TRUE but when I do
a post to Database then PostgreSQL complaint with error: 22008.

Any another idea ?

Thanks...

>>
>>
>> Miguel Juan escribió:
>>> Hi,
>>>
>>> have a look to the class TParam: TParam.Clear ,TParam.Bound and
>>> ftDate
>>>
>>> Regards
>>>
>>> Miguel Juan
>>> ----- Original Message ----- From: "Terry Yapt" <yapt@technovell.com>
>>> To: <pgsql-odbc@postgresql.org>
>>> Sent: Wednesday, May 02, 2007 12:16 PM
>>> Subject: [ODBC] Setting null to date field from Delphi.
>>>
>>>
>>>> I am working with Delphi 2006 and pgsql-odbc driver 8.02.02.00 to
>>>> 8.02.04.00.
>>>>
>>>> I am trying to set a date field to null. In spite of the boolean
>>>> value of 'Dataset.FieldByName('datefield').isnull' is returning
>>>> true (onBeforePost event), PostgreSQL is complaining with error:
>>>> 22008 and showing the date: '0001-00-00' as the wrong date value.
>>>>
>>>> If someone have any idea it would be very appreciated.
>>>>
>>>> Thanks.
>>>>
>>>> ---------------------------(end of
>>>> broadcast)---------------------------
>>>> TIP 6: explain analyze is your friend
>>>>
>>>
>>>
>>>

>>
>>

>
>
>



---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:31 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com