Help with plpgsql - subst variable value

From: "Alexander Bodnar" <bodnar(at)malva(dot)com(dot)ua>
To: pgsql-general(at)postgresql(dot)org
Subject: Help with plpgsql - subst variable value
Date: 2001-02-22 13:31:02
Message-ID: 9734bb$k2s$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all.

This my code snapshot:

CREATE FUNCTION CreateObject(varchar(600)) RETURNS int4 AS '
DECLARE
. . .
ObjectSeqName text;
BEGIN
. . ..
ObjectSeqName := ''ObjectLog'' || ObjectID || ''_Seq'';
CREATE SEQUENCE ObjectSeqName start 1 increment 1 maxvalue 2147483647
minvalue 1 cache 1 CYCLE;
. . .
END IF;
RETURN ObjectID;
END;
' LANGUAGE 'plpgsql';

When I run this function I got
ERROR: parser: parse error at or near "$1"

So how can get value of ObjectSeqName in sequence/table/etc. name?

Browse pgsql-general by date

  From Date Subject
Next Message Louis-David Mitterrand 2001-02-22 13:45:46 inconstistent inheritance in 7.1?
Previous Message Carlos Garcia 2001-02-22 13:27:02 System Catalog