Add explicit @RC handling in SQL for delete/update procs

Updated DeleteObjectProcedureHandler and UpdateObjectProcedureHandler to declare, initialize, and select the @RC variable in their SQL command strings. This ensures the stored procedure return code is explicitly captured and returned by the query.
This commit is contained in:
2026-01-20 15:39:54 +01:00
parent ff4ab9efe2
commit 304490d661
2 changed files with 2 additions and 0 deletions

View File

@@ -60,6 +60,7 @@ public class DeleteObjectProcedureHandler(IRepository repo) : IRequestHandler<De
};
var result = await repo.ExecuteQueryRawAsync(
"DECLARE @RC SMALLINT = 0; " +
"EXEC @RC = [dbo].[PRREC_DELETE_OBJECT] " +
"@pENTITY, @pSTART, @pEND, @pFORCE; " +
"SELECT @RC;",

View File

@@ -114,6 +114,7 @@ public class UpdateObjectProcedureHandler(IRepository repo) : IRequestHandler<Up
};
var result = await repo.ExecuteQueryRawAsync(
"DECLARE @RC SMALLINT = 0; " +
"EXEC @RC = [dbo].[PRREC_UPDATE_OBJECT] " +
"@pENTITY, @pGUID, @pCHANGED_WHO, @pCHANGED_WHEN, " +
"@pACTION_PROFILE_ID, @pACTION_ACTIVE, @pACTION_SEQUENCE, @pACTION_ENDPOINT_ID, @pACTION_ENDPOINT_AUTH_ID, @pACTION_ENDPOINT_PARAMS_ID, @pACTION_SQL_CONNECTION_ID, @pACTION_TYPE_ID, @pACTION_PRE_SQL, @pACTION_HEADER_SQL, @pACTION_BODY_SQL, @pACTION_POST_SQL, @pACTION_ERROR_ACTION_ID, " +