home *** CD-ROM | disk | FTP | other *** search
- /**************************/
- /* delete customer record */
- /**************************/
- Arg window
- ret=0
-
- /* Start Using The Database */
- call sqldbs 'START USING DATABASE dbsample IN SHARED MODE';
- if (SQLCA.SQLCODE <> 0) then do
- response=VpMessageBox(window,TITLE,'START USING DATABASE Error : SQLCODE = ' SQLCA.SQLCODE)
- return SQLCA.SQLCODE
- end
-
- /* Create The SQL Delete Statement and invoke */
- prep_string = "DELETE FROM userid.customer WHERE "
- prep_string = prep_string || "CUST_CUSTOMER_ID = " || cust.customer_id
-
- call sqlexec 'EXECUTE IMMEDIATE :prep_string';
- if ( SQLCA.SQLCODE <> 0) & (SQLCA.SQLCODE <> 100) then do
- response=VpMessageBox(window,MSGTITLE,'Error deleting customer record. 'SQLCA.SQLMSG)
- ret = 1
- end
-
- /* Stop Using The Database */
- call sqldbs 'STOP USING DATABASE';
- if (SQLCA.SQLCODE <> 0) then do
- response=VpMessageBox(window,TITLE,'STOP USING DATABASE Error : SQLCODE = ' SQLCA.SQLCODE)
- return SQLCA.SQLCODE
- end
-
- return ret