Previous Topic: Notes for SQL AccessNext Topic: FOR Constructs (CA Datacom/DB Native Access)


EXEC SQL Statement (SQL Access)

EXEC SQL delimits an embedded SQL statement. The end of the SQL statement is marked by END‑EXEC.

This statement has the following format:

EXEC SQL
       SQL‑statement
END‑EXEC

You can code the EXEC SQL statement, the SQL statement, and the END‑EXEC on a single line or on multiple lines. You can omit the END‑EXEC if the SQL statement is immediately followed by another EXEC SQL statement. For more information about embedded SQL, see the "Procedure Definition Language Statements" chapter.

Example

EXEC SQL
      UPDATE DELINQUENT_ACCT
        SET ACCT_NO = :PNL_ACCT_NO
        WHERE PAST_DUE GT 90
END‑EXEC