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
List_Attributes_with_References
(Relation)


Vytvořeno: 12-11-1995 11:58:26
Poslední změna: 12-10-2002 10:57:27

Outputs a list of all the attributes of the specified relation. For each attribute information is given about foreign keys, type structures, and dialog elements referencing the attribute.

Modul

Module: Relation

Zdrojový kód:

PROCEDURE List_Attributes_with_References FOR RELATION
BEGIN
/*
  list attributes of relation with referencing information
*/

  PRINT {BOLD,"ARIAL",12} "Atributy relace ";
  PRINT {BOLD,"ARIAL",12,ITALIC} CONV$(Boxname);
  PRINT {BOLD,"ARIAL",12} " s referencemi",NL(2);

  PRINT {BOLD,"ARIAL",10} TAB(4),CONV$(Relation.Boxname),NL;
  first%=0;
  found%=0;
  FOREACH Relattribute WHERE Relattribute.Relation=Relation.Name ORDER BY Position DO
    foreign%=0;
    first%=1;
    FOREACH Relrshipattribute WHERE
                          Relrshipattribute.Targetattribute=Relattribute.Name
                      AND Relrshipattribute.Target=Relation.Name DO
      foreign%=1;
      BREAK;
    END
    // not a foreign key
    PRINT {"ARIAL",10} TAB(4);
    IF foreign%=0 THEN
      IF Relattribute.Pkey=0 THEN
        PRINT {"ARIAL",10} Relattribute.Name,NL;
      ELSE
        PRINT {"ARIAL",UNDERLINE,10} Relattribute.Name,NL;
      END
    ELSE // is foreign key
      IF Relattribute.Pkey=0 THEN
        PRINT {"ARIAL",10} Relattribute.Name,NL;
      ELSE
        PRINT {"ARIAL",10,UNDERLINE} Relattribute.Name,NL;
      END
    END
    
    //Index
    FOREACH Indexattribute WHERE Indexattribute.Relation=Relation.Name
                    AND Indexattribute.Attribute=Relattribute.Name AND Type=0 DO
      PRINT {"ARIAL"} TAB(8),"Typová struktura";
      PRINT {"ARIAL",8,ITALIC} TAB(18),Indexattribute.Index;
      PRINT {"ARIAL",8} TAB(36),"(index)",NL;
      found%=1;
    END

    //Constraint
    FOREACH Indexattribute WHERE Indexattribute.Relation=Relation.Name
                    AND Indexattribute.Attribute=Relattribute.Name DO
      FOR Index WHERE Name=Indexattribute.Index
      AND Relation=Relattribute.Relation AND (Type=1 OR Type=2) DO
          PRINT {"ARIAL"} TAB(8),"Integritní omezení:";
          PRINT {"ARIAL",8,ITALIC} TAB(18),Indexattribute.Index;
          PRINT {"ARIAL",8} TAB(36),"(omezení atributu)",NL;
          found%=1;
      END
    END

    //Relattribute in TSD
    FOREACH Tfield WHERE Tfield.Relattribute=Relattribute.Name ORDER BY Typestructure DO
      FOR Typestructure WHERE Typestructure.Name=Tfield.Typestructure DO
        PRINT {"ARIAL",8} TAB(8),"Typová struktura:";
        PRINT {"ARIAL",8} TAB(18),CONV$(Typestructure.Boxname);
        PRINT {"ARIAL",8} TAB(36),"(atributová položka)",NL;
        found%=1;
      END
    END
    
    //Attribute-Connection
    FOREACH Attributeconnection WHERE Relation = Relation.Name
                                  AND Relattribute = Relattribute.Name DO
      PRINT {"ARIAL"} TAB(8),"Entita: ";
      FOR Entity WHERE Entity.Name = Attributeconnection.Entity DO
        PRINT {"ARIAL",8,ITALIC} TAB(18), Entity.Boxname;
      END
      PRINT {"ARIAL",8} TAB(36), "(atribut: ";
      PRINT {"ARIAL",8,ITALIC} Attributeconnection.Attribute , ")",NL;
      found%=1;
    END
    
    // Widget-Attribute
    FOREACH Widgetattribute WHERE Relation=Relation.Name
                              AND Attribute=Relattribute.Name ORDER BY Resource DO
      FOR Widget WHERE Name=Widgetattribute.Resource
                   AND Module=Widgetattribute.Module DO
        FOR Funcdef WHERE Funcdefno=Widgetattribute.Funcdefno
                      AND Module=Widget.Module DO
          PRINT {"ARIAL",8} TAB(8),"Modulová struktura:";
          FOR Module WHERE Name=Funcdef.Module DO
            PRINT {"ARIAL",8,ITALIC} TAB(20),CONV$(Boxname);
          END
          PRINT {"ARIAL",8} TAB(36),"(dialogová funkce: ";
          PRINT {"ARIAL",8,ITALIC} CONV$(Funcdef.Boxname);
          PRINT {"ARIAL",8} ")",NL;
          PRINT {"ARIAL",8} TAB(20),"prvek dialogu: ";
          PRINT {"ARIAL",8,ITALIC} TAB(36),Widget.Name,NL;
          found%=1;
        END
      END
    END
  END

  IF found%=0 THEN
    IF first%=0 THEN
      PRINT {"ARIAL",ITALIC,10} TAB(4),"Neexistují žádné atributy.",NL;
    ELSE
      PRINT {"ARIAL",ITALIC,10} TAB(4),"Atributy nemají žádné reference.",NL;
    END
  END
  
  PRINT NL;

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\11660.htm (C) microTOOL GmbH 2002