Skip site navigation (1) Skip section navigation (2)

Help with plpgsql - subst variable value

From: "Alexander Bodnar" <bodnar(at)malva(dot)com(dot)ua>
To: <pgsql-general(at)postgresql(dot)org>, <pgsql-interfaces(at)postgresql(dot)org>
Subject: Help with plpgsql - subst variable value
Date: 2001-02-22 14:45:44
Message-ID: 001e01c09cde$23465ae0$0f00200a@alex (view raw or flat)
Thread:
Lists: pgsql-interfaces
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-interfaces by date

Next:From: Postgres The BestDate: 2001-02-22 14:51:54
Subject: Re: FOR UPDATE is not allowed in this context - Solved
Previous:From: Luis MagaaDate: 2001-02-22 14:33:19
Subject: Errors in other languages

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group