Входные параметры
Параметр | Тип | Описание |
---|---|---|
CLASSID |
INTEGER |
|
ROUTEID |
INTEGER |
|
Выходные параметры
Параметр | Тип | Описание |
---|---|---|
SILAGEID |
INTEGER |
|
SILAGENAME |
VARCHAR(20) |
|
WEIGHT |
INTEGER |
|
CROPCLASSNAME |
VARCHAR(100) |
|
QUALITYID |
INTEGER |
|
STORAGEID |
INTEGER |
|
PERCENTWEIGHT |
INTEGER |
|
HUMIDITY |
INTEGER |
|
DIRT |
INTEGER |
|
ROUTECHEMAID |
INTEGER |
|
Описание
(Нет описания для процедуры SAMPLER_SELECTSILAGE)
Определение
CREATE PROCEDURE SAMPLER_SELECTSILAGE(
CLASSID INTEGER,
ROUTEID INTEGER)
RETURNS (
SILAGEID INTEGER,
SILAGENAME VARCHAR(20),
WEIGHT INTEGER,
CROPCLASSNAME VARCHAR(100),
QUALITYID INTEGER,
STORAGEID INTEGER,
PERCENTWEIGHT INTEGER,
HUMIDITY INTEGER,
DIRT INTEGER,
ROUTECHEMAID INTEGER)
AS
begin
routechemaid = :routeid;
for
select routesilagechema.silageid, silage.name, silage.weight, quality_CropFullName.cropfullname,
silagepacks.storageid, ROUTESILAGECHEMA.PERCENTWEIGHT, silagepacks.qualityid,
quality_select.humidity, quality_select.dirt
from routesilagechema
left join silage on (silage.silageid = routesilagechema.silageid)
left join silagepacks on (silage.silagepackid = silagepacks.silagepackid)
left join quality_select (silagepacks.qualityid) on 0 = 0
left join quality_CropFullName(quality_select.cropid, quality_select.classid, 0, 0) on 0 = 0
where routesilagechema.routechemaid = :routeid
union
select silage.silageid, silage.name, silage.weight, quality_CropFullName.cropfullname,
silagepacks.storageid, ROUTESILAGECHEMA.PERCENTWEIGHT, silagepacks.qualityid,
quality_select.humidity, quality_select.dirt
from silage
left join silagepacks on (silage.silagepackid = silagepacks.silagepackid)
left join silagequality on (silagequality.silagequalityid = silagepacks.silagequalityid) -- added
left join quality_select(silagequality.qualityid) on (0 = 0) -- added
left join quality_CropFullName(quality_select.cropid, quality_select.classid, 0, 0) on 0 = 0
left join storage on (silagepacks.storageid = storage.storageid)
left join routesilagechema on (silage.silageid = routesilagechema.silageid and routesilagechema.routechemaid = :routeid)
where quality_select.classid = :classid
and silagepacks.qualityid is not null
and silage.weight is not null
and routesilagechema.routesilagechemaid is null
order by 6, 1
into :silageid, :silagename, :weight, :cropclassname, :storageid, :PERCENTWEIGHT,
:QUALITYID, :HUMIDITY, :DIRT
do begin
suspend;
end
END