select * from SSInspectDoc where InspectID=122
select * from SSInspectDoc where InspectID=122
CREATE OR REPLACE PROCEDURE SUPERMAG.USR_INSP_DocWIUseEGAIS (
indoctype IN smdocuments.doctype%TYPE,
indocid IN smdocuments.ID%TYPE,
inoldstate IN smdocuments.docstate%TYPE := NULL,
innewstate IN smdocuments.docstate%TYPE := NULL,
indummy IN core.smbool := NULL )
IS
-- Проверка №122 без учета операции "Списание брака"
doc_opcode supermag.smdocuments.locationfrom%TYPE;
BEGIN
-- Если операция документа = 7, завершаем проверку
SELECT d.opcode
INTO doc_opcode
FROM supermag.smdocuments d
WHERE d.id = indocid AND d.doctype = indoctype;
IF doc_opcode=7 THEN RETURN; END IF;
-- Вызов стандартной проверки 122
INSPECT2.DocWIUseEGAIS(indoctype, indocid, inoldstate, innewstate, indummy);
END USR_INSP_DocWIUseEGAIS;
/
DECLARE
INSPECT_ID supermag.ssinspectfunc.id%TYPE := 950;
INSPECT_NAME supermag.ssinspectfunc.name%TYPE := 'Пользовательская проверка №122';
INSPECT_ORANAME supermag.ssinspectdoc.inspectoraname%TYPE := 'USR_INSP_DocWIUseEGAIS';
BEGIN
insert into supermag.ssinspectfunc(id, name, definspectmode) values (INSPECT_ID, INSPECT_NAME, 2);
insert into supermag.ssinspectdoc (doctype, docstate, docstatebefore, inspectid, inspectoraname, dobefore)
values ('WI', 3, 2, INSPECT_ID, INSPECT_ORANAME, 1);
insert into supermag.ssinspectdoc (doctype, docstate, docstatebefore, inspectid, inspectoraname, dobefore)
values ('WO', 3, 2, INSPECT_ID, INSPECT_ORANAME, 1);
commit;
END;
/