Progress
Embedded SQL-92
Guide and Reference


Elements of a Query

ESQL supports SELECT statements for performing queries. A SELECT statement can return one or more rows.

EXAMPLE

The following code fragment shows a SELECT statement that retrieves the values of the last_name and city columns for a specific customer in the customer table:

EXEC SQL BEGIN DECLARE SECTION ;
     CHAR  name_v [30] ;
     CHAR  city_v [20] ;
     LONG  cust_no_v ;
EXEC SQL END DECLARE SECTION ;
   .
   .
   .
/*
** Application processing here, to assign values to host variables.
*/

EXEC SQL
     SELECT last_name, city
     INTO :name_v, :city_v
     FROM customer
     WHERE cust_no = :cust_no_v; 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095