Subject | Re: Duplicate keys |
---|---|
Author | Stephen Boyd |
Post date | 2005-10-11T13:44:52Z |
--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@m...>
wrote:
LDS_STOP_ID := GEN_ID(LDS_GEN, 1);
CreateStopRecord(LDS_STOP_ID);
LDSI_STOP_ID := LDS_STOP_ID;
LDSI_ITEM_NUMBER := 1;
while (there_are_more_item_records) do
begin
UpdateItemRecord(LDSI_STOP_ID, LDSI_ITEM_NUMBER);
LDSI_ITEM_NUMBER := LDSI_ITEM_NUMBER + 1;
end;
Where UpdateItemRecord calls the aforementioned snippet of stored
procedure to update / insert the item record.
wrote:
> if LDSI_STOP_ID is a generator value PK, how do you get multiplevalues which
> LDSI_STOP_IDs such that you can have sequential LDSI_STOP_ITEM
> start from 1?In really brief psuedo-code it goes like this:
> Alan
>
LDS_STOP_ID := GEN_ID(LDS_GEN, 1);
CreateStopRecord(LDS_STOP_ID);
LDSI_STOP_ID := LDS_STOP_ID;
LDSI_ITEM_NUMBER := 1;
while (there_are_more_item_records) do
begin
UpdateItemRecord(LDSI_STOP_ID, LDSI_ITEM_NUMBER);
LDSI_ITEM_NUMBER := LDSI_ITEM_NUMBER + 1;
end;
Where UpdateItemRecord calls the aforementioned snippet of stored
procedure to update / insert the item record.