Informační tok Funkční structura Datová struktura ER model Modulová struktura Typová struktura Relační model Dokumentace


[Celkový datový model] [Funkce] [Externí rohraní] [Stavové diagramy] [Datové elementy] [Entity] [Relace]
[Databáze] [Události] [Materiály] [Generovací funkce] [Vyhodnocovací funkce] [Konfigurace] [Uživatelé] [Projekt] [Home]



Vyhodnocovací funkce
Relation_with_Attributes
(Relation)


Vytvořeno: 12-08-1995 18:42:18
Poslední změna: 12-09-2002 15:16:47

Outputs all attributes of the specified relation; indicates whether an attribute belongs to a primary or foreign key definition.

Modul

Module: Relation

Zdrojový kód:

PROCEDURE Relation_with_Attributes(Name$)
BEGIN
/*
  list attributes of relations
*/
  anyAttribute%=0;
  FOR Relation WHERE Name=Name$ DO
    PRINT {BOLD,"ARIAL",10} CONV$(Relation.Boxname),NL;
    FOREACH Relattribute WHERE Relattribute.Relation=Relation.Name ORDER BY Position DO
      foreign%=0;
      FOREACH Relrshipattribute WHERE
                            Relrshipattribute.Targetattribute=Relattribute.Name
                        AND Relrshipattribute.Target=Relation.Name DO
        foreign%=1;
      END
      anyAttribute%=1;
      // not used as foreign key
      IF foreign%=0 THEN
        IF Relattribute.Pkey=0 THEN
          PRINT {"ARIAL",8} TAB(8),Relattribute.Name;
        ELSE
          PRINT {"ARIAL",8} TAB(4),"P",TAB(8);
          PRINT {"ARIAL",UNDERLINE,8} Relattribute.Name;
        END
      ELSE // used as foreign key
        IF Relattribute.Pkey=0 THEN
          PRINT {"ARIAL",8} TAB(4),"F",TAB(8),Relattribute.Name;
        ELSE
          PRINT {"ARIAL",8} TAB(4),"PF",TAB(8);
          PRINT {"ARIAL",8,UNDERLINE} Relattribute.Name;
        END
      END
      FOR Data WHERE Data.Name=Relattribute.Data DO
        PRINT {"ARIAL",8} TAB(36),"(",Data.Boxname,")";
      END
      PRINT NL;
      
    END
    IF anyAttribute% = 0 THEN
      PRINT {"Arial",10,ITALIC} TAB(4),"Nemá atributy.",NL;
    END
    PRINT NL;
  END

END


Generováno: 16.10.2003 7:41 Systém: C:\Documents and Settings\hajsman\Dokumenty\Vyuka\Irs2\Projekt case40\Projekt03.csf Generováno systémem case/4/0
Vygeneroval: Administrator Soubor: C:\Documents and Settings\hajsman\Dokumenty\Vyuka\Irs2\Projekt case40\html\22991.htm (C) microTOOL GmbH 2002