
May 22nd, 2012, 06:05 AM
|
|
Registered User
|
|
Join Date: Mar 2012
Posts: 1
Time spent in forums: 19 m 51 sec
Reputation Power: 0
|
|
|
Error on PostgreSQL Function
Kindly i need solution for a below error when i was run the the function.
ERROR: query has no destination for result data
HINT: If you want to discard the results of a SELECT, use PERFORM instead.
CONTEXT: PL/pgSQL function "example" line 8 at SQL statement
********** Error **********
ERROR: query has no destination for result data
SQL state: 42601
Hint: If you want to discard the results of a SELECT, use PERFORM instead.
Context: PL/pgSQL function "example" line 8 at SQL statement
--------------------------------------------------------------
create or replace function example(id int)
returns setof record as
$s$
begin
if id = 0 then
select * from sm;
else
select * from asd ;
end if;
end;
$s$
language 'plpgsql';
select example(1);
|