Subject Info
Author Nico Speleers
Hi,

Ex.
CREATE TABLE ADDRESSES (
ID INTEGER GENERATED BY DEFAULT AS IDENTITY NOT NULL,
ADDRESSNAME VARCHAR(100) COLLATE UNICODE_CI_AI,
STREETNAME VARCHAR(100) COLLATE UNICODE_CI_AI,
STREETNUMBER VARCHAR(100) COLLATE UNICODE_CI_AI,
STREETNUMBERBOX VARCHAR(100) COLLATE UNICODE_CI_AI,
EXTRAADDRESSLINE VARCHAR(100) COLLATE UNICODE_CI_AI,
WEBSITE VARCHAR(100) COLLATE UNICODE_CI_AI,
EMAILADDRESS VARCHAR(100) COLLATE UNICODE_CI_AI,
CALLINGCODEHOMEPHONE VARCHAR(10) COLLATE UNICODE_CI_AI,
HOMEPHONE VARCHAR(100) COLLATE UNICODE_CI_AI,
CALLINGCODEBUSINESSPHONE VARCHAR(10) COLLATE UNICODE_CI_AI,
BUSINESSPHONE VARCHAR(100) COLLATE UNICODE_CI_AI,
CALLINGCODEFAX VARCHAR(10) COLLATE UNICODE_CI_AI,
FAX VARCHAR(100) COLLATE UNICODE_CI_AI,
POSTALCODEID INTEGER NOT NULL,
ROWVERSION TIMESTAMP,
/* Keys */
CONSTRAINT PK_ADDRESSES
PRIMARY KEY (ID),
/* Foreign keys */
CONSTRAINT FK_ADDRESSES_POSTALCODEID
FOREIGN KEY (POSTALCODEID)
REFERENCES POSTALCODES(ID)
);

Id = 1 / AddressName = Test / ......
Id = 2 / AddressName = Test2 / ......

I want to know the next Id number in my table Addresses without an insert. In my example it will be 3. I want to reserve (without an insert) Id number 3 because someone else can also ask the next Id number. In that case it must be id number = 4, because you've got Number 1 and 2 in the table and number 3 is reserved.

How can I do that ?

Thanks.

Nico Speleers
Team Lead Analyse & Consultancy





Carfac bvba

[Beschrijving: Beschrijving: Beschrijving: CarfacAS (klein)]<http://www.carfac.be/>Driving on experience


Ambachtstraat 8 | 9700 Oudenaarde
Tel. +32 55 23 00 00 | Fax +32 55 31 00 95
nico.speleers@...<mailto:nico.speleers@...> | www.carfac.be<http://www.carfac.be/>

[Facebook]<http://www.facebook.com/groups/120709181286476/>[LinkedIn]<http://www.linkedin.com/company/hdc-software-nv>[Twitter]<https://twitter.com/carfacbvba>





[Non-text portions of this message have been removed]