heitml takes the
World Wide Web
to a higher level!

Introduction
heitml Features
Language Guide
       

Language Reference

   General Design
   Lexical Structure
   Expressions
   heitml Tags
   heitml Functions
   Accessing databases
   Server Variables
   Sessions
   heitml Syntax
       
The heitml Libraries
Supported Platforms
User Guide
Download
User Registration
Discussion Group
Mailinglist
       
NEW!
heitml 1.2 new features


Send us mail

Contact Info

   

Language Reference
by Helmut Emmelmann, PhD
and Keith Oustalet

heitml Tags to access the database

Accessing the database is done by the <dbquery> tag. It has the following syntax:

<dbquery queryname>    SQL-Querystatement 
   <dbrow>               text for every row
   <dbtop>               top of table
   <dbfoot>              foot of table
   <dbempty>             in case of empty result
</dbquery>

The SQL-Querystatement must be a valid SQL-SELECT statement. The SQL-Querystatement is processed in HTML mode . All heitml tags can be used to generate the desired SQL-Query.

The SQL statement is executed and the row section is processed repeatedly for every row selected. The row section is processed in HTML mode. It may contain the ? tag to include the content of a database field within the page. However, the row part may contain any other HTML or heitml tags, including nested queries or update statements.

An arbitrary queryname can be choosen distinct from the names of local variables. The fields of the selected rows are accessed by writing queryname.fieldname (e.g. if the query was named q, then <? q.firstname> prints the firstname field in the database). In fact queryname denotes a heitml tuple that contains the current row. The tuple can be read as any other tuple but it can not be written.

The empty section is processed (in HTML mode) if the result of the select statement is empty. Otherwise top and foot sections are processed once, in the beginning and at the end of the table respectively. The advantage of the top and foot section over writing the table head and table foot before and after the query tag is that in case of an empty result table only the text in the empty section is displayed.

Modifying the Database

<dbupdate> SQL-Statement </dbupdate>

The update tag can contain SQL update, delete or insert statements. With appropiate database systems also many other SQL statements are allowed, including create table etc.

The SQL statement is passed unaltered to the database system and is executed immediately.
Format: <dbdatabase > heitml </dbdatabase>

Select a database. This is neccessay only if you want to change the database during processing. (See also configuartion files.)

Accessing Anonymous Relations


<dbquery queryname> SQL-Querystatement 
   <dbhead>         headline for a column  
   <dbbody>         sperator between head & body 
   <dbrow>          text for every row
   <dbcolumn>       text for column 
   <dbrowend>       end of text for every row
</dbquery>

This form of the <dbquery> Tag can be used to display a table whose field names are not known a priori. It first shows a headline with one entry for every field. This entry is specified after dbhead. It can use the special variable SrvFname to access the name of the current field. Afterwards a seperator, dbbody, is printed. Note that you can leave out the headline by leaving out both the dbhead and dbbody parts.

All records in the table are then shown. For each record, first the text in dbrow is shown; then for every field the text in dbcolum and finally the text in dbrowend. Inside dbcolumn, the special variable SrvField can be used to access the field content and SrvFname can be used to access the field name.

dbtop and dbfoot can be used as in the usual dbquery Tag. It is also possible to give a name to the current tuple and access specific fields, all as documented with the normal database access.


This page was dynamically generated by
heitml
© 1996-1997 H.E.I. All Rights Reserved

heitml documentation (c) 1997 H.E.I. GmbH Mannheim, Germany