ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

IDMS: How to retrieve the ROWID after an INSERT


Article ID: 196904


Updated On:


IDMS IDMS - Database


This document describes how to retrieve the ROWID of the most recently INSERTed row in an IDMS/SQL program.

This would be analogous to addressing the DBKEY field or using the ACCEPT DB-KEY verb against a network-defined database.


Release : 19.0
Component : CA IDMS/SQL


The GET DIAGNOSTICS statement can be used in a program to retrieve the ROWID of the most recently INSERTed row.

The attachment below is the source code of a batch program which shows how this can be done. 
It performs an INSERT, retrieves the ROWID, and then issues a SELECT against the same table based on the retrieved ROWID.

This example requires the use of Virtual Foreign Key support. 

Attachments get_app