| From: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
|---|---|
| To: | vincent <waimeng(at)efkonasia(dot)com(dot)my> |
| Cc: | <pgsql-sql(at)postgresql(dot)org> |
| Subject: | Re: Function calling error in postgreSQL 7.3.1 |
| Date: | 2003-03-13 06:05:29 |
| Message-ID: | 20030312220435.F61658-100000@megazone23.bigpanda.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Len Morgan | 2003-03-13 07:34:34 | Re: What's wrong with this group by clause? |
| Previous Message | vincent | 2003-03-13 03:09:32 | Function calling error in postgreSQL 7.3.1 |