From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: vincent <waimeng@efkonasia.com.my>
Cc: pgsql-sql@postgresql.org
Subject: Re: Function calling error in postgreSQL 7.3.1
Date: Wed, 12 Mar 2003 22:05:29 -0800 (PST)
Message-ID: <20030312220435.F61658-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <b4oseb$101n$1@news.hub.org>
On Thu, 13 Mar 2003, vincent wrote:
> Hi all,
>
> I'm trying to create a function that take in 2 varchar string and return a
> string.
> The function was created successfully, but when i issued the following
> command via pgadmin II,
> it give me the following error:
>
> select * from sc_company.dbseq('sc_company', 'COMPANY');
>
> ERROR: Namespace "in_schname" does not exist
>
>
> CREATE FUNCTION sc_company.dbseq(text, text) RETURNS varchar AS '
> DECLARE
> in_schname ALIAS FOR $1;
> in_seqname ALIAS FOR $2;
> retval VARCHAR := 0;
> BEGIN
> SELECT SEQ_VAL INTO retval FROM in_schname.DB_SEQ WHERE SEQ_NAME =
> in_seqname;
That is not going to use the argument in the FROM. If you want to do
something like that you're probably going to need to look into using
EXECUTE.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: sszabo@megazone23.bigpanda.com, waimeng@efkonasia.com.my
Subject: Re: Function calling error in postgreSQL 7.3.1
In-Reply-To: <20030312220435.F61658-100000@megazone23.bigpanda.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox