Need help (unterminated dollar-quoted string at or near "$$ LANGUAGE plpgsql IMMUTABLE; ") - Mailing list pgsql-novice

From Hitesh Varule
Subject Need help (unterminated dollar-quoted string at or near "$$ LANGUAGE plpgsql IMMUTABLE; ")
Date
Msg-id CAHM4AP-9+dnQO7_BB3GNL8_mpduvA8vw1h7qjx_rcyY7JSpVpA@mail.gmail.com
Whole thread Raw
Responses Re: Need help (unterminated dollar-quoted string at or near "$$ LANGUAGE plpgsql IMMUTABLE; ")  (Rob Richardson <RDRichardson@rad-con.com>)
List pgsql-novice
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

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Details of Segmentation Fault
Next
From: "Kevin Grittner"
Date:
Subject: Re: Details of Segmentation Fault