How to get the External Table Primary Key which is auto generated when inserting a new record in DB with RDB-Save method in Pega
Dears,
I am trying to use below query to insert data to external table. (Pega to MS SQL database)
INSERT INTO BKRP.STBL ( MainRequestId, StatusId, AssignmentId, CreationDate, TypeId) VALUES( {.MainRequestId}, {.StatusID}, {.AssignmentId}, {.CreationDate}, {.TypeId} ); COMMIT; |
Above table is configured to generate the primary key of the table (Id) as auto generated.
Using RDB-Save I am able to save the data to the external DB successfully.
But I need to get the auto generated ID (Primary Key) of the particular record real time after insertion.
For that with the same above query I tried adding below statement before and after COMMIT; statement in above query.
select scope_identity();
But still I am not able to get the ID (Primary key of the table which is auto generated in DB side).
Dears,
I am trying to use below query to insert data to external table. (Pega to MS SQL database)
INSERT INTO BKRP.STBL ( MainRequestId, StatusId, AssignmentId, CreationDate, TypeId) VALUES( {.MainRequestId}, {.StatusID}, {.AssignmentId}, {.CreationDate}, {.TypeId} ); COMMIT; |
Above table is configured to generate the primary key of the table (Id) as auto generated.
Using RDB-Save I am able to save the data to the external DB successfully.
But I need to get the auto generated ID (Primary Key) of the particular record real time after insertion.
For that with the same above query I tried adding below statement before and after COMMIT; statement in above query.
select scope_identity();
But still I am not able to get the ID (Primary key of the table which is auto generated in DB side).
Is there any way to get the autogenerated ID (Primary Key) from the external table just after executing the insert statement in Pega?
Thanks & Regards,
Surath