FAQ
I'm passing some information to postges (from gambas basic), which gets the
data from date type

eg date1 as date
date2 as date

(IN the postgres database the default on the date field is null)

my problem is that postgres baulks when I"ve not put a date into one of the
gambas date variables with the message:

"invalid syntax for type date '00:00:00'"

my sql is far more complex but reduced to the date part reads something like
this

insert into mytable (date1, date2) values

('01/01/2008','00:00:00')

I wondered if anyone could volunteer a solution

Regards

Richard

Search Discussions

  • Stephan Szabo at Jul 17, 2008 at 10:34 pm

    On Fri, 18 Jul 2008, richard terry wrote:

    I'm passing some information to postges (from gambas basic), which gets the
    data from date type

    eg date1 as date
    date2 as date

    (IN the postgres database the default on the date field is null)

    my problem is that postgres baulks when I"ve not put a date into one of the
    gambas date variables with the message:

    "invalid syntax for type date '00:00:00'"

    my sql is far more complex but reduced to the date part reads something like
    this

    insert into mytable (date1, date2) values

    ('01/01/2008','00:00:00')
    '00:00:00' isn't a date. Are you sure that the second isn't meant to be a
    time?
  • Richard terry at Jul 18, 2008 at 12:59 am

    On Fri, 18 Jul 2008 08:34:14 am Stephan Szabo wrote:
    On Fri, 18 Jul 2008, richard terry wrote:
    I'm passing some information to postges (from gambas basic), which gets
    the data from date type

    eg date1 as date
    date2 as date

    (IN the postgres database the default on the date field is null)

    my problem is that postgres baulks when I"ve not put a date into one of
    the gambas date variables with the message:

    "invalid syntax for type date '00:00:00'"

    my sql is far more complex but reduced to the date part reads something
    like this

    insert into mytable (date1, date2) values

    ('01/01/2008','00:00:00')
    '00:00:00' isn't a date. Are you sure that the second isn't meant to be a
    time?
    Interesting observation, I'll ask on the gambas list. In gambas one declares a
    date type as per the above, and the 00:00:00 is obviously the default of an
    empty date for some reason (or as you say date/time). Thanks for replying, at
    least this puts me on a track.

    Regards

    Richard

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedJul 17, '08 at 10:20p
activeJul 18, '08 at 12:59a
posts3
users2
websitepostgresql.org
irc#postgresql

2 users in discussion

Richard terry: 2 posts Stephan Szabo: 1 post

People

Translate

site design / logo © 2022 Grokbase