Hitesh Varule
2012-09-10 11:17:28 UTC
Hi,
Need your help.
we have created a function similar to below:
CREATE OR REPLACE FUNCTION aud_status_to_flag(aud_status character) RETURNS
integer AS $$
DECLARE
auditflag integer;
BEGIN
CASE aud_status
WHEN 'C' THEN
auditflag = 1;
WHEN 'U' THEN
auditflag = 2;
WHEN 'D' THEN
auditflag = 3;
ELSE
CASE
WHEN aud_status SIMILAR TO '[0-9]+' THEN
auditflag = CAST(aud_status as integer);
ELSE
auditflag = 0;
END CASE;
END CASE;
RETURN auditflag;
END;
$$ LANGUAGE plpgsql IMMUTABLE;
If we run the script through INSTALL-SHIELD then we get an error message
like "unterminated dollar-quoted string at or near "$$ LANGUAGE plpgsql
IMMUTABLE; "
we did change the function to STABLE but that didn't solve the problem.
Also, we did put everything in single quoted strings but that as well
didn't resolve the issue.
Please can you let me know what should we do to run script successfully
through INSTALLSHIELD?
Appreciate your help.
Thank you,
Hitesh
Need your help.
we have created a function similar to below:
CREATE OR REPLACE FUNCTION aud_status_to_flag(aud_status character) RETURNS
integer AS $$
DECLARE
auditflag integer;
BEGIN
CASE aud_status
WHEN 'C' THEN
auditflag = 1;
WHEN 'U' THEN
auditflag = 2;
WHEN 'D' THEN
auditflag = 3;
ELSE
CASE
WHEN aud_status SIMILAR TO '[0-9]+' THEN
auditflag = CAST(aud_status as integer);
ELSE
auditflag = 0;
END CASE;
END CASE;
RETURN auditflag;
END;
$$ LANGUAGE plpgsql IMMUTABLE;
If we run the script through INSTALL-SHIELD then we get an error message
like "unterminated dollar-quoted string at or near "$$ LANGUAGE plpgsql
IMMUTABLE; "
we did change the function to STABLE but that didn't solve the problem.
Also, we did put everything in single quoted strings but that as well
didn't resolve the issue.
Please can you let me know what should we do to run script successfully
through INSTALLSHIELD?
Appreciate your help.
Thank you,
Hitesh