This lesson is locked
A short preview is available. Purchase once for lifetime access.
Beginner Β· 20:51
Embedded SQL Foundations: Static SQL and Host Variables
Embedded SQL lets an RPG program state what data it needs rather than navigating to it record by record. This lesson covers the SQLRPGLE source type and the SQL precompiler, EXEC SQL statements, host variables and host data structures, SELECT INTO for single-row retrieval, and INSERT, UPDATE,β¦
What you'll be able to do
- 1Explain what the SQL precompiler does with an SQLRPGLE source member, and code EXEC SQL statements correctly in free format.
- 2Declare host variables and host data structures whose types match their columns, and use them in SELECT INTO, INSERT, UPDATE, and DELETE statements.
- 3Test SQLSTATE after every statement and distinguish success, no data, warnings, and errors.
- 4Use indicator variables to detect null values, including the null returned by an aggregate over no rows.
- 5Use SET OPTION to fix commitment control and date format at compile time, and GET DIAGNOSTICS to obtain the number of rows affected.
Create your account
Takes a few seconds β you'll be right back here after.