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