We know that we can access the Identity value using: values IDENTITY_VAL_LOCAL() into :IdentVal. This needs to be performed immediately following the Insert into....
But there is an alternative:
select Identity into :IdentVal from final table (insert into TABLE (field1, .......) Values (:Data, ......))
Obviously need to check sqlcode/sqlstate for success, but the entire insert and tell me what the value of the Identity field was is performed in a single sql action.