User Tools

Site Tools


rpg:null_values_in_rpg

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
rpg:null_values_in_rpg [2018/02/28 13:21]
mihael
rpg:null_values_in_rpg [2018/02/28 13:21] (current)
mihael
Line 1: Line 1:
 ====== Null Values in RPG ====== ====== Null Values in RPG ======
-If you want to process null values in an embedded SQL statement in RPG you need to pass an additional indicator variable for each host variable. The indicator variable must be written after the host variable separated by a space. The indicator variable is no boolean field of type ''​N''​. It has to be of the SQL type //​SMALLINT//​ which corresponds to the RPG type ''​5I 0''​ (or int(5) according to the IBM Information Center.+If you want to process null values in an embedded SQL statement in RPG you need to pass an additional indicator variable for each host variable. The indicator variable must be written after the host variable separated by a space. The indicator variable is no boolean field of type ''​N''​. It has to be of the SQL type //​SMALLINT//​ which corresponds to the RPG type ''​5I 0''​ (or int(5) according to the IBM Information Center.
  
 If the SQL statements returns a valid value in the host variable the indicator variable has the value of ''​0''​. If the host variable contains a null value the indicator variable has a value of ''​-1''​ or ''​-2''​. If the SQL statements returns a valid value in the host variable the indicator variable has the value of ''​0''​. If the host variable contains a null value the indicator variable has a value of ''​-1''​ or ''​-2''​.
rpg/null_values_in_rpg.txt ยท Last modified: 2018/02/28 13:21 by mihael