Skip site navigation (1) Skip section navigation (2)

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

From: Hitesh Varule <hiteshvarule(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Need help (unterminated dollar-quoted string at or near "$$ LANGUAGE plpgsql IMMUTABLE; ")
Date: 2012-09-10 11:17:28
Message-ID: CAHM4AP-9+dnQO7_BB3GNL8_mpduvA8vw1h7qjx_rcyY7JSpVpA@mail.gmail.com (view raw or flat)
Thread:
Lists: 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

Responses

pgsql-novice by date

Next:From: Kevin GrittnerDate: 2012-09-10 12:27:06
Subject: Re: Details of Segmentation Fault
Previous:From: Tom LaneDate: 2012-09-10 01:21:31
Subject: Re: Details of Segmentation Fault

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group