psqlexception syntax error at or near "$"
| От | Steven Dahlin |
|---|---|
| Тема | psqlexception syntax error at or near "$" |
| Дата | |
| Msg-id | AANLkTikYP447Gt9hBRS0eY5_JCir0uWePV_sTd7rY8ea@mail.gmail.com обсуждение исходный текст |
| Ответы |
Re: psqlexception syntax error at or near "$"
|
| Список | pgsql-jdbc |
In attempting to execute ddl that will create functions I am getting errors which will not allow the functions to be created. In running with the 8.4 driver if I attempt the following:
CREATE OR REPLACE FUNCTION system_info_fnc01() RETURNS trigger AS
$$
declare
iCnt integer;
begin
select count(*) into iCnt from system_info;
if ( iCnt > 0 ) then
raise exception ''System Info record already present'';
end if;
return new;
end;
$$
LANGUAGE 'plpgsql' IMMUTABLE
I get an error with the $$. In substituting an ' for $$ the following occurs:
unterminated quoted string at or near "' declare iCnt integer"
If I then set the delimiter to something like '|' I still get the unterminated quote string problem. Could someone tell me how to get around this problem?
Thanks
CREATE OR REPLACE FUNCTION system_info_fnc01() RETURNS trigger AS
$$
declare
iCnt integer;
begin
select count(*) into iCnt from system_info;
if ( iCnt > 0 ) then
raise exception ''System Info record already present'';
end if;
return new;
end;
$$
LANGUAGE 'plpgsql' IMMUTABLE
I get an error with the $$. In substituting an ' for $$ the following occurs:
unterminated quoted string at or near "' declare iCnt integer"
If I then set the delimiter to something like '|' I still get the unterminated quote string problem. Could someone tell me how to get around this problem?
Thanks
В списке pgsql-jdbc по дате отправления: