diner - THE HTTP-server for the BeOS
Contents

[ CGI ]
[ Info ]
[ FBQuery ]
[ Include ]
[ List ]
[ Query ]

[ Up ]

FBQuery

This module is able to perform a SQL query in a FrontBase database. To do this, the content of the given block is repeated for every row found. The columns have to be refernced by numbers currently, starting with 0 for the first column.

The FBQuery module uses some additional header arguments, that can be given in the <Block> tag right after the module name.

SQL This specifies the query to send to the FrontBase server. "SQL query string" is a sql92 sql query string. This string must not with a semicolon!
Database Database ist the name of the database to connect to.
User The user to use in the connection. Defaults to "BEOS USER".
Password The password to use. Default is no password.

Restictions: As this module is still in a very early state not everything will work as expected. Known problems are:

  • Only text columns or columns which can easily be converted to strings can be queried.
  • Columns can only be accessed by numbers (starting with 0 for the first column).
  • Only select queries are supported. This is not enforced but will lead to undefined results.


Now, have a look at an example:
Note: For this example to work you need a databse named diner containing a table with the same name and two columns, used here as key/balue pairs.

<table cellpadding=5 border=0 width=100%>
<tr>
<th bgcolor="blue"><font color="white">Name</font></th>
<th bgcolor="blue"><font color="white">Value</font></th>
</tr>

<Block FBQuery "SQL=select * from diner" "Database=diner" "User=BEOS USER">
<tr> <td bgcolor="#f0d000"><font color="black"><Var 0></font></td>
<td bgcolor="#f0d000"><font color="black"><Var 1></font></td>
</tr>
</Block>

Copyright © 1997-99 Stegemann & Co., Inc., all rights reserved.
Created: November 22, 1999. Last modified: November 22, 1999.