By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

ERROR: SELECT query has no destination for result data;

P: 66
Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE FUNCTION public.f_customerlogininfo
  2. (
  3.   varchar,
  4.   varchar,
  5.   varchar
  6. )
  7. RETURNS SETOF public.v_customerlogininfo AS'
  8. declare
  9.     p_schm alias for $1;
  10.     p_contact alias for $2;
  11.     p_status alias for $3; /* all - regardless of the status
  12.                               true - true status will be displayed
  13.                               false - false status will be displayed
  14.                            */
  15.     v_boolstatus boolean;
  16. begin
  17.     if (p_status = ''all'') then
  18.         select * from v_customerlogininfo
  19.         where contact = p_contact;
  20.     else
  21.         if (p_status = ''true'') then
  22.             v_boolstatus := true;
  23.         else
  24.             v_boolstatus := false;
  25.         end if;
  26.  
  27.         select * from v_customerlogininfo
  28.         where contact = p_contact
  29.             and status = v_boolstatus;
  30.     end if;
  31. end
  32. 'LANGUAGE 'plpgsql'

Expand|Select|Wrap|Line Numbers
  1. select f_customerlogininfo('public', '09045612378', 'all');
ERROR: SELECT query has no destination for result data;
Aug 13 '07 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 534
You are mixing up sql and plpgsql methods in your plpgsql function.
The man pages I linked to your other posting will help you to sort it out.
Aug 14 '07 #2

P: 66
You are mixing up sql and plpgsql methods in your plpgsql function.
The man pages I linked to your other posting will help you to sort it out.
Thank you Sir. I will follow the link.
Aug 15 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.