Subject | RE: [firebird-support] Obtaining the minor number that does not exist |
---|---|
Author | Leyne, Sean |
Post date | 2010-09-01T19:46:30Z |
> Is it possible to obtain by means of a consultation the minor number thatIf you are running a version which supports EXECUTE BLOCK you could do:
> does not exist in a status of numbers?
EXECUTE BLOCK
RETURNS (
FreeInt Integer
) AS
declare variable iFound SmallInt
BEGIN
iFound = 1;
FreeInt = -1;
DO WHILE (iFound = 1) BEGIN
FreeInt = FreeInt + 1;
iFound = 0;
SELECT 1
FROM Table
WHERE ID = (:Freeint + 0)
INTO :iFound;
END
SUSPEND;
END
Sean