<TITLE>SQL example</TITLE>
<SCRIPT LANGUAGE="Speedscript">
define variable iCust-num as integer no-undo.
define variable cName as character no-undo.
define variable cAddress as character no-undo.
DECLARE custrec CURSOR FOR SELECT cust-num,name,address FROM customer.
OPEN custrec.
{&OUT} "<table border=1><tr><th>number</th><th>Name</th><th>Address</th></tr>" skip.
REPEAT:
FETCH custrec INTO iCust-num, cName, cAddress.
{&OUT} "<tr><td>" iCust-num "</td><td>" cName "</td><td>" cAddress "</td></tr>" skip.
END.
{&OUT} "</table>".
CLOSE custrec.
</SCRIPT>