-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Thursday 17 July 2003 03:46, Terence Kearns wrote:
> CREATE FUNCTION base.fn_fkey_check(text, text, int4) RETURNS bool AS
> 'DECLARE
> BEGIN
>RETURN (SELECT count($1) FROM $2 where $1 = $3)::bool;
> END;'
> LANGUAGE 'sql';
>
> produces this erro
On Thu, 17 Jul 2003, Terence Kearns wrote:
> CREATE FUNCTION base.fn_fkey_check(text, text, int4) RETURNS bool AS
> 'DECLARE
> BEGIN
>RETURN (SELECT count($1) FROM $2 where $1 = $3)::bool;
> END;'
> LANGUAGE 'sql';
>
> produces this error
> ERROR: parser: parse error at or near "RETURN" at c
Terence Kearns wrote:
CREATE FUNCTION base.fn_fkey_check(text, text, int4) RETURNS bool AS
'DECLARE
BEGIN
RETURN (SELECT count($1) FROM $2 where $1 = $3)::bool;
END;'
LANGUAGE 'sql';
produces this error
ERROR: parser: parse error at or near "RETURN" at character 20
I'm trying to create a functi
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
> I'm trying to create a function to use on a trigger to check reference
> to views since pg does not support foreign keys referencing views.
Can you explain exactly what you are trying to do and why? You are getting
the error because a SQL functi
CREATE FUNCTION base.fn_fkey_check(text, text, int4) RETURNS bool AS
'DECLARE
BEGIN
RETURN (SELECT count($1) FROM $2 where $1 = $3)::bool;
END;'
LANGUAGE 'sql';
produces this error
ERROR: parser: parse error at or near "RETURN" at character 20
I'm trying to create a function to use on a trigger