DEFINE VARIABLE iHandle AS INTEGER NO-UNDO.
DEFINE VARIABLE iMax AS INTEGER NO-UNDO. RUN STORED-PROC send-sql-statement iHandle = PROC-HANDLE ("SELECT max (custnum) FROM customer"). FOR EACH proc-text-buffer: iMax = INTEGER(SUBSTRING(proc-text, 1, 3)). DISPLAY iMax. END. CLOSE STORED-PROC send-sql-statement WHERE PROC-HANDLE = iHandle. |