CREATE OR REPLACE FUNCTION GETPACKNAME( DOC_ID IN smdocuments.ID%TYPE ) RETURN varchar2 is pt varchar2(200); BEGIN select t.PACKNAME into pt from supermag.SLSPECPACKS t where t.DOCID=DOC_ID and t.doctype='WO'; return pt; EXCEPTION WHEN OTHERS THEN RETURN NULL; END;
CREATE OR REPLACE FUNCTION GETPACKNAME( DOC_ID IN smdocuments.ID%TYPE,myspecitem in number )
RETURN varchar2
is
pt varchar2(200);
BEGIN
select t.PACKNAME into pt
from supermag.SLSPECPACKS t
where t.DOCID=DOC_ID and t.doctype='WO' and t.SPECITEM=myspecitem;
return pt;
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END;
SUPERMAG.GETPACKNAME({Заголовок документа. Номер документа},{Заголовок документа. Код позиции спецификации})