To retrieve the identity column value, use the INSERT statement and declare one host variable to retrieve that value. Below are three syntax examples:
EXEC SQL INSERT [INTO] <table name> VALUES (...expressions) RETURNING :HOSTVARIABLE,... EXEC SQL INSERT [INTO] <table name> (column name) VALUES (...expressions) RETURNING :HOSTVARIABLE,... EXEC SQL INSERT [INTO] <table name> DEFAULT VALUES RETURNING :HOSTVARIABLE,...