quotes nightmare!

From: "Graham Vickrage" <graham(at)digitalplanit(dot)com>
To: "Postgres SQL" <pgsql-sql(at)postgresql(dot)org>
Subject: quotes nightmare!
Date: 2002-02-22 13:18:51
Message-ID: NDBBJABDILOPAOOMFJHOGECGDEAA.graham@digitalplanit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I am having trouble with my quotes in a function and think I have tried
every comb (obviously not) as it does not work:

I am trying to create a function within a function passing the second
function into the first as a parameter as follows:-

CREATE FUNCTION _test(text) RETURNS int AS '
BEGIN
EXECUTE ''
CREATE FUNCTION _test'' || $1 || '' () RETURNS int AS ''
BEGIN
RAISE EXCEPTION ''Help'';
RETURN 2;
END''; LANGUAGE ''plpgsql'' '';
RETURN 1;
END;'
LANGUAGE 'plpgsql';

SELECT _test('ing');

Could anyone tell me which bit is causing the problem as I am now completely
lost, the error message mentions is near LANGUAGE.

Many thanks

Graham.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Samuel J. Sutjiono 2002-02-22 14:46:30 How does Index Scan get used
Previous Message Andre Holzner 2002-02-22 09:17:12 Re: Array slice subscripts (was Re: [SQL] plpgsql function