🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.interbase.sql
2 messages
2 total messages Started by Andrew Jameson Wed, 04 Dec 2002 16:35
Primary Keys and Generators
#11158
Author: Andrew Jameson
Date: Wed, 04 Dec 2002 16:35
23 lines
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)
Re: Primary Keys and Generators
#11159
Author: Craig Stuntz TeamB
Date: Wed, 04 Dec 2002 17:47
19 lines
1610 bytes
In article <3dee2e1d@newsgroups.borland.com>, contact@softspotsoftware.com 
says...
> I'm using a TIBOQuery ...
> 
	TIBOQuery or TIBQuery?  If the former, you should ask this question 
on the IBO support list -- IBO, no doubt, has a feature to handle 
generators.

	If the latter, look at the GeneratorField property.

	HTH,

	-Craig

-- 
Craig Stuntz [TeamB] � Vertex Systems Corp. � Columbus, OH
Delphi/InterBase Weblog : http://delphi.weblogs.com
InterBase Perf. Monitor : http://delphi.weblogs.com/IBPerformanceMonitor
InterBase PLANalyzer 1.1: http://delphi.weblogs.com/IBPLANalyzer
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