Я еще не видел описания структуры таблиц по ЕГАИС (может, и пропустил), если кому-то надо - запрос остатков по третьему регистру, как он происходит в соответствующем разделе, получен трассировкой:
SQL код:
Select RestsDate, ExchangeState, ErrorText
from
Supermag.SMEgaisRestsRg3Header where OurFSRARID='020000100000' and
InformBRegId='*'
SQL код:
Select InformBRegId, RestsDate, ExchangeState, ErrorText
from
Supermag.SMEgaisRestsRg3Header where OurFSRARID='020000100000' and
InformBRegId<>'*' order by InformBRegId
SQL код:
Select R.MarkCode, R.AlcCode,(select min(A.ProductFullName)
from
Supermag.SMEgaisArticles A where A.AlcCode=R.AlcCode and A.ProductFullName
is not null) as ProductFullName, R.InformBRegId, R.TTNGlid, nvl((select
W.DocNumber from Supermag.SVEgaisDocHeader W where W.GLID=R.TTNGlid),
'#'||R.TTNGlid) as TTNNumber, R.Existing, decode(E.ExchangeState, null, '0',
'1') as Registry3, R.RestsDate, E.RestsDate as EgaisRestsDate,
E.ExchangeState, E.ErrorText from Supermag.SVEgaisRestsPiece R, (select
H.OurFSRARID, H.InformBRegId, H.RestsDate, H.ExchangeState, H.ErrorText,
S.MarkCode as MrCd from Supermag.SMEgaisRestsRg3Header H,
Supermag.SMEgaisRestsRg3 S where S.OurFSRARID=H.OurFSRARID and
S.InformBRegId=H.InformBRegId) E where E.MrCd(+)=R.MarkCode and
E.InformBRegId(+)=R.InformBRegId and E.OurFSRARID(+)=R.OurFSRARID and
R.OurFSRARID='020000100000' and Existing <> '0' order by AlcCode,
InformBRegId, MarkCode