Einzelnen Beitrag anzeigen

mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.861 Beiträge
 
Delphi 11 Alexandria
 
#2

Re: Interbase StoredProc anlegen. Fehlermeldung

  Alt 21. Aug 2006, 17:23
SQL-Code:
SET TERM ^;
create procedure nextFreeLiefNumber ( lBound char(7), uBound char(7))
    returns (A_RETURN INTEGER) AS
declare freienummer double;
begin
  For
    SELECT o.L1_NR as freienummer FROM FLIEF_1 o where o.L1_nr between lBound and uBound
        AND NOT EXISTS (SELECT i.L1_NR FROM FLIEF_1 i
            WHERE cast(i.L1_NR as double precision) = cast(o.L1_NR as double precision) + cast(1 as double precision)) into :freienummer do
    A_RETURN = cast(freienummer as double precision)+1;
    suspend;
end
SET TERM ;^
getiipt und nicht getestet.
Markus Kinzler
  Mit Zitat antworten Zitat