【发布时间】:2014-12-05 08:34:06
【问题描述】:
此函数基于 Oracle PL/SQL 函数:
create or replace FUNCTION SP_ComputeEntity (P_ENTITY NUMERIC, P_CAMPAIGN NUMERIC, P_COMPLETE_IF NUMERIC, P_COMPUTE_MODE NUMERIC ) RETURNS VOID AS $$
DECLARE
[..]
-- This is the list of the entity's subordinates
[..]
-- This is the list of the entity's questionnaires
[..]
BEGIN
-- If the entity must not be computed for this campaign stop
[..]
-- Check if already computed .
[..]
-- If not already computed compute it now .
IF V_EXISTS = 0 THEN
-- Loop on subordinates to check if already computed
OPEN ENTITY_COLUMNS;
LOOP
FETCH ENTITY_COLUMNS INTO V_COLUMN_ID;
EXIT WHEN ENTITY_COLUMNS%NOTFOUND;
SP_ComputeEntity(V_COLUMN_ID, P_CAMPAIGN, P_COMPLETE_IF, P_COMPUTE_MODE);
END LOOP;
CLOSE ENTITY_COLUMNS;
[..]
END;
$$
LANGUAGE plpgsql;
我的问题是 pgAdmin III 给了我 错误:“SP_ComputeEntity”处或附近的语法错误 SQL 状态:42601 人物:1773 我不知道为什么。可以做到吗?有人可以在 postgresql 中调用相同的函数吗?
【问题讨论】:
标签: sql oracle postgresql