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
RelIndex
(Web Publishing)


Vytvořeno: 03-27-2000 12:35:35
Poslední změna: 01-10-2003 11:09:02

Outputs detailed information about the given index defined in the actual system.

Modul

Module: Web Publishing

Zdrojový kód:

PROCEDURE RelIndex(Relation$, Name$)
BEGIN

  foundsomething! = FALSE;
  FOR Index WHERE Relation = Relation$
            AND Name = Name$ DO
    foundsomething! = TRUE;
    CALL Header("Index - " + Name);
    FOR Relation WHERE Relation.Name = Index.Relation DO
      CALL Title2("Index", Index.Name, Conv$(Relation.Boxname));
    END
  END

  //display a dummy title if the index does not exist
  IF NOT foundsomething! THEN
    CALL Header("Index - " + name$);
    CALL Title ("Index", name$);
    PRINT {HTML} "<BR>",NL;
  END

  IF foundsomething! THEN
    FOR Index WHERE Relation = Relation$
              AND Name = Name$ DO
    
      //general object data
      CALL GenObjectData(Object, FALSE, FALSE);
      PRINT {HTML} "<HR SIZE=""1"" COLOR=""#3366CC"">", NL;

      //two column table with properties of the index - one line per attribute
      CALL H2_TopSpaceless("Vlastnosti");
      PRINT {HTML} "<TABLE NOWRAP VALIGN=BASELINE>",NL;
      //relation
      PRINT {HTML} " <TR>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      PRINT {HTML} "<B>Relace:</B></FONT></TD>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      FOR Relation WHERE Name = Index.Relation DO
        PRINT {HTML} Anchor$("<I>" + Conv$(Boxname) + "</I>", "", Str$(Object) + ".htm");
      END
      PRINT {HTML} "</FONT></TD></TR>",NL;
      //Unique
      PRINT {HTML} " <TR>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      PRINT {HTML} "<B>Jednoznačný:</B></FONT></TD>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      IF Unique THEN
          PRINT {HTML} "<I>ano</I></FONT></TD>",NL;
      ELSE
          PRINT {HTML} "<I>ne</I></FONT></TD>",NL;
      END
      PRINT {HTML} " </TR>",NL;
      //NotNull
      PRINT {HTML} " <TR>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      PRINT {HTML} "<B>Povolena hodnota null:</B></FONT></TD>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      IF Notnull THEN
          PRINT {HTML} "<I>ne</I></FONT></TD>",NL;
      ELSE
          PRINT {HTML} "<I>ano</I></FONT></TD>",NL;
      END
      PRINT {HTML} " </TR>",NL;
      //Cluster Index
      PRINT {HTML} " <TR>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      PRINT {HTML} "<B>Cluster index:</B></FONT></TD>",NL;
      PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
      IF Clustered THEN
          PRINT {HTML} "<I>ano</I></FONT></TD>",NL;
      ELSE
          PRINT {HTML} "<I>ne</I></FONT></TD>",NL;
      END
      PRINT {HTML} " </TR>",NL;
      //end of table
      PRINT {HTML} "</TABLE>",NL;
      PRINT {HTML} "<HR SIZE=""1"" COLOR=""#3366CC"">", NL;

      //two column table with userdefined properties of the element - one line per property
      CALL GenUserdefinedProperties(Object);

      //table with all indexattributes
      CALL H2_TopSpaceless("Atributy indexu");
      foundattr! = FALSE;
      FOREACH Indexattribute WHERE Relation = Index.Relation
                             AND Index = Index.Name
                             ORDER BY Position DO
        foundattr! = TRUE;
        BREAK;
      END
      IF foundattr! THEN
        PRINT {HTML} "<TABLE CELLPADDING=2 VALIGN=BASELINE NOWRAP>", NL;
        PRINT {HTML} " <TR>", NL;
        PRINT {HTML} " <TH ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial""></FONT></TH>", NL;
        PRINT {HTML} " <TH ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">Název</FONT></TH>", NL;
        PRINT {HTML} " <TH ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">Řazení</FONT></TH>", NL;
        PRINT {HTML} " </TR>", NL;

        FOREACH Indexattribute WHERE Relation = Index.Relation
                               AND Index = Index.Name
                               ORDER BY Position DO
          PRINT {HTML} " <TR>";

          //name of the attribute
          PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
          PRINT {HTML} "<IMG SRC=""bullet.gif"" ALIGN=""top""></FONT></TD>";
          PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
          FOR Relattribute WHERE Relation = Indexattribute.Relation
                           AND Name = Indexattribute.Attribute DO
            PRINT {HTML} Anchor$("<B>" + Name + "</B>", "", Str$(Object) + ".htm");
          END
          PRINT {HTML} "</FONT></TD>",NL;
          
          //ascending, descending
          PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
          IF Desc THEN
            PRINT {HTML} "sestupně", NL;
          ELSE
            PRINT {HTML} "vzestupně", NL;
          END
          PRINT {HTML} "</FONT></TD></TR>",NL;
        END
        PRINT {HTML} "</TABLE>", NL;

      ELSE
        PRINT {HTML} "Index nemé definovány žádné atributy.<BR>", NL;
      END
      PRINT {HTML} "<BR>",NL;

      IF Clustered THEN
        //partitions
        CALL H2_TopSpaceless("Partitions");
        foundPart! = FALSE;
        FOREACH Partition WHERE Relation = Index.Relation
                          AND Index = Index.Name ORDER BY Number DO
          foundPart! = TRUE;
          BREAK;
        END
        IF foundPart! THEN
          PRINT {HTML} "<TABLE CELLPADDING=2 VALIGN=BASELINE NOWRAP>", NL;
          PRINT {HTML} " <TR>", NL;
          PRINT {HTML} " <TH ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial""></FONT></TH>", NL;
          PRINT {HTML} " <TH ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">Číslo</FONT></TH>", NL;
          PRINT {HTML} " <TH ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">Hodnota</FONT></TH>", NL;
          PRINT {HTML} " </TR>", NL;

          FOREACH Partition WHERE Relation = Index.Relation
                            AND Index = Index.Name ORDER BY Number DO

            //generate the pages for the partition
            CALL Partition(Id) INTO Str$(Object) + ".htm";
            
            PRINT {HTML} " <TR>", NL;

            //number
            PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
            PRINT {HTML} "<IMG SRC=""bullet.gif"" ALIGN=""top""></FONT></TD>";
            PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
            PRINT {HTML} Anchor$("<B>" + Str$(Number) + "</B>", "", Str$(Object) + ".htm");
            PRINT {HTML} "</FONT></TD>", NL;
            //value
            PRINT {HTML} " <TD ALIGN=LEFT VALIGN=TOP><FONT SIZE=2 FACE=""Verdana, Arial"">";
            IF Value <> "" THEN
              PRINT {HTML} Value;
            END
            PRINT {HTML} "</FONT></TD></TR>", NL;
          END
          PRINT {HTML} "</TABLE><BR>", NL;
        END

        IF NOT foundPart! THEN
           PRINT {HTML} "Index nemá definovány žádnou partition.", "<BR>", NL;
        END
        PRINT {HTML} "<BR>",NL;
      END

      //source code
      CALL H2_TopSpaceless("Zdrojový kód indexu " + Name$);
      PRINT {HTML} "<FONT SIZE=4 FACE=""Courier, Courier New"">",NL;
      PRINT {HTML} "<LISTING>",NL;
      SET STYLE {HTML};
      CALL "SQL" DEFAULT FOR Index;
      SET STYLE {"Arial", 10};
      PRINT {HTML} "</LISTING>",NL;
      PRINT {HTML} "</FONT>",NL;

    END
  ELSE
    CALL H2_Spaceless("Neexistuje index daného jména.");
    PRINT {HTML} "<BR>",NL;
  END
  CALL Footer("");
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\188190000.htm (C) microTOOL GmbH 2002