Re: Create function problem

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Create function problem
Дата
Msg-id 20060804003334.GA42945@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: Create function problem  (gustavo halperin <ggh.develop@gmail.com>)
Список pgsql-general
On Fri, Aug 04, 2006 at 06:16:41AM +0300, gustavo halperin wrote:
> *OK thank you, you right, but after write "public" I receive again an
> empty row, Why??.
[...]
> mydb=> CREATE OR REPLACE FUNCTION f_describe_tables (v_tbl_scm text,
> v_tbl_name text,
> mydb(> OUT  text, OUT text) as
> mydb-> $$ SELECT c.column_name, c.data_type
> mydb$> FROM information_schema.columns c
> mydb$> WHERE c.table_schema = 'v_tbl_schm' AND c.table_name = 'v_tbl_name'
> mydb$> $$ LANGUAGE SQL;

You've hardcoded the strings 'v_tbl_schm' and 'v_tbl_name' instead
of using the function's arguments.  I don't think SQL functions
support named arguments so you'll need to use $1 and $2.  You'll
also need to use "RETURNS SETOF record" if you want to return more
than one row.

--
Michael Fuhr

В списке pgsql-general по дате отправления:

Предыдущее
От: gustavo halperin
Дата:
Сообщение: Re: Create function problem
Следующее
От: "Jaime Casanova"
Дата:
Сообщение: Re: Dumping database using 8.1 or 7.1