Progress
Embedded SQL-92
Guide and Reference


INPUT Host Variables in DML Statements

The host variables that you use for input in an SQL statement are referred to as INPUT host variables. These variables must be declared in the DECLARE SECTION before you can use them in ESQL executable statements. You can use them in ESQL statements wherever a constant is valid. INSERT, UPDATE, and DELETE DML statements reference INPUT host variables.

EXAMPLE

The following example shows input host variable references in DML statements:

EXEC SQL
   INSERT INTO customer
       (cust_no, last_name, street, city, state)
   VALUES       (:cust_no_v, :name_v, :street_v, :city_v, :state_v) ;
 
 
EXEC SQL
    UPDATE customer
    SET  phone = ’(203) 555-2793’
    WHERE cust_no = :cust_no_v ; 

NOTE: Prepend a colon ( : ) to any host variables you use in ESQL executable statements.


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