Article View: borland.public.interbase.sql
Article #125Re: insert into problem
From: Bill Todd [TeamB]
Date: Sun, 08 Jun 2008 16:24
Date: Sun, 08 Jun 2008 16:24
31 lines
2120 bytes
2120 bytes
Isaac wrote: > What I should do in case I already have data in this table also this > table has two primary key one of them get the value from the master > table and other one should count from 1 for each different value from > the other field > > example > f1(key from master) f2(count) > 1 1 > 1 2 > 2 1 > . > . > . > > > Thanks FYI, a table can only have one primary key but the primary key can consist of more than one field. I assume the purpose of the COUNT field is to preserve the order in which the records were added to the table. If so, the COUNT field does not have to be 1,2,3. It can be any ascending sequence of integer numbers which means that you can use a generator. It is extremely difficult to number a group of records 1 through N in a multi-user environment. If you think you must have 1,2,3 etc. tell us why. Maybe the design can be changed to avoid that requirement. -- Bill Todd (TeamB)
Technical Details
Message-ID:
<484c07a9$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<484b07da@newsgroups.borland.com> <484b16e4@newsgroups.borland.com> <484b52eb$1@newsgroups.borland.com> <484c007f@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,ed255c09332ecd2c
X-Google-Attributes: gid114a0e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Bill Todd [TeamB]" <no@no.com>
Subject: Re: insert into problem
Newsgroups: borland.public.interbase.sql
References: <484b07da@newsgroups.borland.com> <484b16e4@newsgroups.borland.com> <484b52eb$1@newsgroups.borland.com> <484c007f@newsgroups.borland.com>
Organization: The Database Group, Inc.
User-Agent: XanaNews/1.18.1.9
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 63.147.41.232
Message-ID: <484c07a9$1@newsgroups.borland.com>
Date: 8 Jun 2008 09:24:09 -0700
X-Trace: newsgroups.borland.com 1212942249 63.147.41.232 (8 Jun 2008 09:24:09 -0700)
Lines: 31
X-Authenticated-User: btodd
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail