Входные параметры
Параметр | Тип | Описание |
---|---|---|
INVENTORYID |
INTEGER |
|
Выходные параметры
Параметр | Тип | Описание |
---|---|---|
SILAGESTRING |
VARCHAR(255) |
|
Описание
(Нет описания для процедуры SAMPLER_SILAGENAME)
Определение
CREATE PROCEDURE SAMPLER_SILAGENAME(
INVENTORYID INTEGER)
RETURNS (
SILAGESTRING VARCHAR(255))
AS
DECLARE VARIABLE SILAGENAME VARCHAR(30);
DECLARE VARIABLE PERCENTWEIGHT INTEGER;
begin
silagestring = '';
for
select silage.name, routesilagechema.percentweight
from it
left join routesilagechema on (it.routeid = routesilagechema.routechemaid)
left join silage on (routesilagechema.silageid = silage.silageid)
where it.inventoryid = :inventoryid
into :silagename, :percentweight
do begin
if (:silagename is not null) then
if (:silagestring = '') then silagestring = coalesce(:silagename, '')|| '(' || coalesce(:percentweight, '')|| ')';
else silagestring = silagestring || ', ' || coalesce(:silagename, '')|| '(' || coalesce(:percentweight, '') || ')';
end
suspend;
end