DBeaver 未编译使用 psql 客户端编译的函数
DBeaver not compiling a function that compiles using psql client
我可以使用 psql 客户端编译下一个函数。但是,DBeaver-ce returns 报错
SQL Error [42601]: Unterminated dollar quote started at position 0 in SQL $$;. Expected terminating $$".
为什么?
CREATE OR REPLACE FUNCTION numOf_icd10cm_4_snomed(oldCode TEXT)
RETURNS integer
LANGUAGE plpgsql
AS
$$
-- This function returns the nunber of icd10cm codes matching oldCode in the table snomed2icd10
DECLARE
quantity integer;
BEGIN
quantity := (select count(maptarget)
from
snomed2icd10
where
referencedcomponentid = oldCode
);
return quantity;
END;
$$;
尝试将整个内容包含在 DbVis SQL block 中,使用 --/ 和 / 包装 DDL(或 DML),即:
--/
CREATE OR REPLACE FUNCTION numOf_icd10cm_4_snomed(oldCode TEXT)
RETURNS integer
LANGUAGE plpgsql
AS
$$
-- This function returns the nunber of icd10cm codes matching oldCode in the table snomed2icd10
DECLARE
quantity integer;
BEGIN
quantity := (select count(maptarget)
from
snomed2icd10
where
referencedcomponentid = oldCode
);
return quantity;
END;
$$;
/
我可以使用 psql 客户端编译下一个函数。但是,DBeaver-ce returns 报错
SQL Error [42601]: Unterminated dollar quote started at position 0 in SQL $$;. Expected terminating $$".
为什么?
CREATE OR REPLACE FUNCTION numOf_icd10cm_4_snomed(oldCode TEXT)
RETURNS integer
LANGUAGE plpgsql
AS
$$
-- This function returns the nunber of icd10cm codes matching oldCode in the table snomed2icd10
DECLARE
quantity integer;
BEGIN
quantity := (select count(maptarget)
from
snomed2icd10
where
referencedcomponentid = oldCode
);
return quantity;
END;
$$;
尝试将整个内容包含在 DbVis SQL block 中,使用 --/ 和 / 包装 DDL(或 DML),即:
--/
CREATE OR REPLACE FUNCTION numOf_icd10cm_4_snomed(oldCode TEXT)
RETURNS integer
LANGUAGE plpgsql
AS
$$
-- This function returns the nunber of icd10cm codes matching oldCode in the table snomed2icd10
DECLARE
quantity integer;
BEGIN
quantity := (select count(maptarget)
from
snomed2icd10
where
referencedcomponentid = oldCode
);
return quantity;
END;
$$;
/