EXEC SQL [ AT Database ] PREPARE { Prepared-Statement } [ INTO Sql-Descriptor ] FROM Sql-String { Host-Var } END-EXEC |
*> insert_rec and count_recs do not need to be defined prior to *> their use in the prepare statements *> min-key and the-count could be pic 9(4) each exec sql prepare insert_rec from "insert into cust_table values (2010,'Evan Raymond','New York')" end-exec exec sql execute insert_rec end-exec exec sql prepare count_recs from "select count(*) from cust_table where cust_code > ?" end-exec move 1990 to min-key exec sql execute count_recs using :min-key into :the-count end-exec display "Count of records with key > " min-key " : " the-count |