Putting It All Together

Putting this all together, the following statement that appears in the select1.sqb program

EXEC SQL
    SELECT MIN(C_NUMBER)
    INTO :MIN-C-NUMBER
    FROM CUSTOMER
END-EXEC.

instructs the program to do the following:

  1. Start executing an embedded SQL statement.
  2. Find the minimum value in the c_number field of the customer table.
  3. Assign that value to the COBOL host variable :min-c-number.
  4. Stop executing the embedded SQL statement.

If you haven't done so already, compile and run the select1 program. These steps provide one input for the statement Select a customer number between 1 and 5.