Входные параметры
Параметр | Тип | Описание |
---|---|---|
QUALITYID |
INTEGER |
|
Выходные параметры
Параметр | Тип | Описание |
---|---|---|
COPYQUALITYID |
INTEGER |
|
Описание
(Нет описания для процедуры QUALITY_COPY_ONLYQUALITY)
Определение
CREATE PROCEDURE QUALITY_COPY_ONLYQUALITY(
QUALITYID INTEGER)
RETURNS (
COPYQUALITYID INTEGER)
AS
declare variable qtypeid integer;
declare variable qvalue numeric(9,2);
begin
if (not exists (select QUALITYID from QUALITY where QUALITYID = :QUALITYID))
then COPYQUALITYID = null;
else begin
CopyQualityID = gen_id(QUALITYIDGEN, 1);
insert into QUALITY(qualityid, cropid, classid, sortid)
select
:CopyQualityID, cropid, classid, sortid
from QUALITY
where QUALITY.QUALITYID = :QUALITYID;
for
select qualitydata.qualitytypeid, qualityvalue
from qualitydata
left join qualitytypes on qualitydata.qualitytypeid = qualitytypes.qualitytypeid
where qualityid = :QUALITYID and (qualitytypes.categoryid in (0, 2) or qualitytypes.qualitytypeid = 6)
into :qtypeid, :qvalue
do
insert into qualitydata(qualityid, qualitytypeid, qualityvalue)
values (:CopyQualityID, :qtypeid, :qvalue);
end
suspend;
END