From: | "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com> |
---|---|
To: | Baurjan Ismagulov <ibr(at)ata(dot)cs(dot)hun(dot)edu(dot)tr> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: SERIAL with TTable in cbuilder |
Date: | 2002-10-04 15:42:02 |
Message-ID: | Pine.LNX.4.33.0210040941150.9244-100000@css120.ihs.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Tue, 1 Oct 2002, Baurjan Ismagulov wrote:
> Hello,
>
> Sorry for a slightly off-topic posting, writing in hope that some of you
> might have encountered and solved the problem I'm experiencing. I've
> searched cbuilder and postgres archives, but couldn't find anything
> relevant.
>
> I'm trying to insert records from a dialog box using TTable (Windows
> client, ODBC). I don't have a control for my SERIAL field. When I
> Table1->Post(), Borland classes raise an exception saying smth. like
> "field xxx should have a value", since the autoincremented field is
> declared NOT NULL. I don't want to read the sequence from the client. Is
> there a way to have TTable not insert a value for that field? I've also
> tried an updatable TQuery where I select all fields except the SERIAL,
> but that didn't work either.
Try using the value DEFAULT with no ' marks around it. like this:
insert into table (dat,nam,id) values ('2000-02-02','Marlowe',DEFAULT);
That should work
From | Date | Subject | |
---|---|---|---|
Next Message | Stephan Szabo | 2002-10-04 15:42:05 | Re: List Foreign Key Relationships |
Previous Message | Stephan Szabo | 2002-10-04 15:40:46 | Re: Deadlock |