display table contents using a stored proc

Поиск
Список
Период
Сортировка
От Manish Raj Sharma
Тема display table contents using a stored proc
Дата
Msg-id 4343C3FE.9010502@aol.net
обсуждение исходный текст
Список pgsql-novice
Hi,

I am new to stored procedures and have been trying to display the
contents of a table using a stored proc as follows:

create or replace function show_table (
     cidr -- ip_block
   ) returns void
   language plpgsql as '
   declare
         block alias for $1;
   begin
       select * from ip_table
       where ip_block = block
       return;
   end;
   ';

When I call the function, I get the following:

mydb=# SELECT show_table('62.51.0.0/16');
ERROR:  SELECT query has no destination for result data
HINT:  If you want to discard the results, use PERFORM instead.
CONTEXT:  PL/pgSQL function "show_table" line 4 at SQL statement

Any help?

Thanks,
-manish


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

Предыдущее
От: Jonathan Tse
Дата:
Сообщение: Order by and index
Следующее
От: "Obe, Regina DND\\MIS"
Дата:
Сообщение: Re: display table contents using a stored proc