IBM Informix Embedded SQLJ User's Guide

######

IBM Informix Embedded SQLJ User's Guide Chapter 4: The Embedded SQLJ Language

Contents | Index |  |

## SELECT Statements That Return a Single Row You use the SELECT...INTO statement for queries that return a single record of data. For queries that return multiple rows (called a result set) you use an iterator object, as described in the next section, "Handling Result Sets." The SELECT...INTO statement includes a list of host variables in the INTO clause to which the selected data is assigned. For example:

    #sql
    {
    SELECT *  INTO :customer_num, :fname, :lname, :company,
    :address1, :address2, :city, :state, :zipcode,
    :phone
    FROM customer
    WHERE customer_num = 101
    };
The number of selected expressions must match the number of host variables. The SQL types must be compatible with the host variable types. If you use on-line checking, the SQLJ translator checks that the order, number, and types of the SQL expressions and host variables match. "On-Line Checking" explains how to perform on-line checking.

IBM Informix Embedded SQLJ User's Guide, Version 1.0
Copyright © 1999, IBM Corporation. All rights reserved.