Module custquery.4gl (function insert_cust)

A new function, insert_cust, in the custquery.4gl module, contains the logic to add the new row to the customer table.

Function insert_cust:
01 FUNCTION insert_cust()
02
03   WHENEVER ERROR CONTINUE
04   INSERT INTO customer (
05     store_num, 
06     store_name, 
07     addr, 
08     addr2, 
09     city, 
10     state, 
11     zip_code, 
12     contact_name, 
13     phone 
14     )VALUES (mr_custrec.*)
15   WHENEVER ERROR STOP
16
17   IF (SQLCA.SQLCODE = 0) THEN
18     MESSAGE "Row added"
19   ELSE
20     ERROR SQLERRMESSAGE
21   END IF
22
23 END FUNCTION
Note: