Einzelnen Beitrag anzeigen

mkinzler
(Moderator)

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

AW: (Rekursive) Suche von Objekten in der DB

  Alt 28. Jun 2011, 16:59
Ich sehe da keine Rekursion.

Gier schon
SQL-Code:
SET TERM ^ ;

create or alter procedure PBAUM (
    IPARENT bigint)
returns (
    ID bigint,
    PARENT bigint,
    TEXT varchar(128))
as
declare variable ANZ integer;
begin
  select count(id) from baum where Parent = :iparent into :anz;
  if (:anz > 0) then
  for select id, parent, text from baum where parent = :iparent into :id, :parent, :text do
  begin
      suspend;
      for select id, parent, text from pbaum( :id) into :id, :parent, :text do begin suspend; end
                                                                                  
                                                                                 
  end
end^

SET TERM ; ^
Markus Kinzler
  Mit Zitat antworten Zitat