From 57f1ce50dcdbf9aba1476a97b579e3aaecfe2111 Mon Sep 17 00:00:00 2001 From: Ernest Litvinenko Date: Fri, 5 Jul 2024 01:09:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0?= =?UTF-8?q?=20ID=5FAPP=5FTASK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 32_7.sql | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/32_7.sql b/32_7.sql index cee0cbe..84309af 100644 --- a/32_7.sql +++ b/32_7.sql @@ -155,7 +155,19 @@ begin NEW_APP_NOTE_STATUS = cast(:EXEC_BLOCK_32_NEG_1_OUT_VAL as D_INTEGER); else if (:EXEC_BLOCK_32_NEG_1_OUT_KEY = 'ID_APP_TASK') then - NEW_APP_NOTE_ID_APP_TASK = cast(:EXEC_BLOCK_32_NEG_1_OUT_VAL as D_BIGINT); + begin + if (exists(select 1 + from APP_TASK T + where T.ID_APP_TASK = cast(:EXEC_BLOCK_32_NEG_1_OUT_VAL as D_BIGINT))) then + NEW_APP_NOTE_ID_APP_TASK = cast(:EXEC_BLOCK_32_NEG_1_OUT_VAL as D_BIGINT); + else + begin + output = -3;/*Не найден APP_TASK*/ + suspend; + exit; + end + + end end