procedure PostDocument
(theDocType in SMDocuments.Doctype%Type,
theId in SMDocuments.Id%Type,
theMX in SMStorelocations.Id%Type)
is
TargetDb number;
begin
if theMX is not null then
Select m.dbaseid into TargetDb
From Supermag.SMPostLocMap m
Where m.storeloc = theMX;
Supermag.SMPostObject(TargetDb, theDocType, theId, 0, null, 0, null);
else
Supermag.SMPostObject(null, theDocType, theId, 0, null, 0, null);
end if;
Exception
When NO_DATA_FOUND Then null;
When Others Then
RAISE_APPLICATION_ERROR (-20000, 'Процедура PostDocument, документ: ' || theId || ' место хранения: ' || to_char(theMX), True);
end PostDocument;