Help with plpgsql - subst variable value - Mailing list pgsql-general

From Alexander Bodnar
Subject Help with plpgsql - subst variable value
Date
Msg-id 9734bb$k2s$1@news.tht.net
Whole thread Raw
List 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?




pgsql-general by date:

Previous
From: Raymond Chui
Date:
Subject: PL/PGSQL Programming Guide/Reference Guide Want
Next
From: mg
Date:
Subject: Re: Error: 'cache lookup failed' w/trigger