IBM Books

Net.Data Reference Guide

SQL

Purpose

This is equivalent to a function called with FUNCTION(DTW_SQL) in Net.Data.

It can contain SQL_REPORT and SQL_MESSAGE statements, which are also from DB2 WWW Connection. DB2 WWW Connection does not support named %SQL blocks.

Examples

This is an example of a DB2 WWW Connection macro.

%SQL{
UPDATE $(dbtbl) SET URL='$(URL)' WHERE ID=$(ID)
%SQL_MESSAGE{
100: "<B>The selected URL no longer exists in the table</B>." : continue
%}
%}
 
%HTML_INPUT{
<HTML>
...
%EXEC_SQL
</HTML>
%}
 
%HTML_REPORT{
<HTML>
...
</HTML>
%}

The same macro in Net.Data looks like this:

%FUNCTION(DTW_SQL) URLquery(){
UPDATE $(dbtbl) SET URL='$(URL)' WHERE ID=$(ID)
%MESSAGE{
100: "<B>The selected URL no longer exists in the table</B>." : continue
%}
%}
 
%HTML(INPUT){
<HTML>
...
@URLquery
</HTML>
%}
 
%HTML(REPORT){
<HTML>
...
</HTML>
%}


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]