Re: About functions

From: "Gregory Wood" <gregw(at)com-stock(dot)com>
To: "Devrim GUNDUZ" <devrim(at)oper(dot)metu(dot)edu(dot)tr>, "Stephan Szabo" <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: "PostgreSQL Mailing Lists-General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: About functions
Date: 2002-02-25 14:02:52
Message-ID: 036e01c1be05$1e605c30$7889ffcc@comstock.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > You can't use the argument as a parameter directly in that sql
statement.
> > You might be able to do:
> > EXECUTE ''DROP FUNCTION '' || $1;
>
> Thanks but, again an error:
>
> test=# CREATE FUNCTION dropfunc(text) RETURNS integer AS '
> test'# BEGIN;
> test'# EXECUTE ''DROP FUNCTION'' $1;
> test'# SELECT 1;
> test'# END;
> test'# '
> test-# LANGUAGE SQL;
> ERROR: parser: parse error at or near "EXECUTE"
> test=#
>
> Let me dive into my manuals :)

I'm pretty sure EXECUTE is only available in the PL/pgSQL language, and not
the SQL language. Also, you need to append the parameter to the rest of the
drop function string, so be sure to include a space after FUNCTION and
concat the two together with ||.

Greg

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Boulgakov, Andrei 2002-02-25 14:05:34 Hebrew support?
Previous Message Glenn MacGregor 2002-02-25 14:01:37 libpq++ and threads