Article View: borland.public.interbase.sql
Article #11158Primary Keys and Generators
From: Andrew Jameson
Date: Wed, 04 Dec 2002 16:35
Date: Wed, 04 Dec 2002 16:35
23 lines
2016 bytes
2016 bytes
Hi, Boy, this is a puzzle ... OK I'm trying to do a new record insertion ... as such the Primary Key is NULL but the database insertion will make my Generator trigger fire and it'll be assigned an incremented number ... great it works ... as long as I clear the Not Null property of the primary key and that gives rise to MetaScript import errors so it can't be the way to do it ! It appears that the Dataset already knows that the field can't be a NULL and intercepts the apparent error before the database can do its stuff ... so how do I tell the Dataset to ignore the fact the Primary Key is a NULL ? ... I'm using a TIBOQuery ... TDataSetProvider ... TClientDataSet ... TDataSource. The only reference that I've come across was by another poor soul who'd resorted to assigning the the Primary Key to -1 in the OnNewRecord event and then triggering his generator on a -1 assignment ... or maybe that's the only way ? Thanks Andrew (Apologizes as this might be the wrong group but it looked more appropriate than the using VCL group)
Technical Details
Message-ID:
<3dee2e1d@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 114a0e,31126bcd78aa19b8,start X-Google-Attributes: gid114a0e,public X-Google-ArrivalTime: 2002-12-04 08:38:06 PST From: "Andrew Jameson" <contact@softspotsoftware.com> Newsgroups: borland.public.interbase.sql Subject: Primary Keys and Generators Date: Wed, 4 Dec 2002 16:35:46 -0000 Lines: 25 Organization: SoftSpot Software X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 NNTP-Posting-Host: 195.102.197.8 Message-ID: <3dee2e1d@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1039019549 195.102.197.8 (4 Dec 2002 08:32:29 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail