The DBMS Tag

    Syntax: {DBMS::SQL Statement::OUTPUT}
    Function:

    It returns the result of the specified SQL Statement and calls an OUTPUT tag which outputs the result in a formatted way. The format is defined in the OUTPUT tag, also which fields of the result set should be printed.

    The database is configurated with the DB tag which is called with the program start. The DB tag contains the name of the database, the connection, username and password.

    If something happens during the database connection or if an exception occurres, the EXCEPTION tag will be called automatically. With the DEF tag (description below) it is possible to redefine the EXCEPTION tag.

    The OUTPUT tag should be defined as follows:

    *OUTPUT {cellname::format}

    where as many cellname::format pairs can be defined as wanted, maximum as much as fields are available. The format is defined with a percent sign (%) first, and then:

    +      forces display of + for positive numbers
    0      Show leading zeroes
    -      align left in the field
    space  prepend a space in front of positive numbers
    #      use "alternate" format. Add 0 or 0x for octal or hexadecimal numbers.
           Don't suppress trailing zeroes in general floating point format.
    Digit  an integer denoting field width (optional)
    Period a period followed by an integer denoting precision (optional)
    Format a format descriptor (required)
    Digit  floating point number in fixed format
    Digit  floating point number in exponential notation (scientific format). The E
           format results in an uppercase E for the exponent (1.14130E+003), the e
           format in a lowercase e.
    Digit  floating point number in general format (fixed format for small numbers,
           exponential format for large numbers). Trailing zeroes are suppressed. The
           G format results in an uppercase E for the exponent (if any), the g format in
           a lowercase e.
    d, I   integer in decimal
    x      integer in hexadecimal
    o      integer in octal
    s      string
    c      character
    

    Example:

    {DBMS::SELECT * FROM Articles::OUTPUT}

    *OUTPUT
    {fFreight::%+4.2f} {iStatus::%d}

Back