%{---------------------------------------------------------%} %{ NDUPDATE - Retrieve/update single record %} %{ %} %{ Craig Pelkie %} %{ Bits & Bytes Programming, Inc. %} %{ craig@web400.com %} %{ Copyright (c) 2001, Craig Pelkie %} %{ ALL RIGHTS RESERVED %} %{---------------------------------------------------------%} %{---------------------------------------------------------%} %{ Section A: Defines for macro %} %{---------------------------------------------------------%} %define { DATABASE = "*LOCAL" DTW_DEFAULT_REPORT = "NO" SHOWSQL = "YES" %} %{---------------------------------------------------------%} %{ Section B: SQL function updateCusrec %} %{---------------------------------------------------------%} %function(dtw_sql) updateCusrec (IN CUSNUM, IN INIT, IN LSTNAM, IN STREET, IN CITY, IN STATE, IN ZIPCOD) { update qgpl.qcustcdt set INIT = '@dtw_raddquote($(INIT))', LSTNAM = '@dtw_raddquote($(LSTNAM))', STREET = '@dtw_raddquote($(STREET))', CITY = '@dtw_raddquote($(CITY))', STATE = '@dtw_raddquote($(STATE))', ZIPCOD = $(ZIPCOD) where CUSNUM = $(CUSNUM) %} %{---------------------------------------------------------%} %{ Section C: SQL function getCusrec %} %{---------------------------------------------------------%} %function (DTW_SQL) getCusrec (IN pmCusnum) { select * from qiws.qcustcdt where cusnum = $(pmCusnum) %report{ %row{ NDUPDATE - Retrieve/update single record %{---------------------------------------------%} %{ Section D - JavaScript %} %{---------------------------------------------%} %{---------------------------------------------%} %{ Section E - HTML Form %} %{---------------------------------------------%}

Customer Record

%{---------------------------------------------%} %{ Section F - Buttons %} %{---------------------------------------------%}
Customer $(V_CUSNUM)
Name
Street
City
%} %} %} %{---------------------------------------------------------%} %{ Section G: HTML section GETCUST %} %{---------------------------------------------------------%} %html (GETCUST) { @getCusrec(pmCusnum) %} %{---------------------------------------------------------%} %{ Section H: HTML section UPDATE %} %{---------------------------------------------------------%} %html (UPDATE) { NDUPDATE - Retrieve/update single record
@updateCusrec($(CUSNUM), $(INIT), $(LSTNAM), $(STREET), $(CITY), $(STATE), $(ZIPCOD))

Customer $(CUSNUM) was updated.

%} %{---------------------------------------------------------%} %{ Section I: HTML section INPUT %} %{---------------------------------------------------------%} %html (INPUT) { NDUPDATE - Retrieve/update single record

Retrieve/update single record

Enter the customer number to retrieve:
%}