ERROR: SELECT query has no destination for result data;

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eros
    New Member
    • Jun 2007
    • 66

    ERROR: SELECT query has no destination for result data;

    Code:
    CREATE OR REPLACE FUNCTION public.f_customerlogininfo
    (
      varchar,
      varchar,
      varchar
    )
    RETURNS SETOF public.v_customerlogininfo AS'
    declare
        p_schm alias for $1;
        p_contact alias for $2;
        p_status alias for $3; /* all - regardless of the status
                                  true - true status will be displayed
                                  false - false status will be displayed
                               */
        v_boolstatus boolean;
    begin
        if (p_status = ''all'') then
            select * from v_customerlogininfo
            where contact = p_contact;
        else
            if (p_status = ''true'') then
                v_boolstatus := true;
            else
                v_boolstatus := false;
            end if;
    
            select * from v_customerlogininfo
            where contact = p_contact
                and status = v_boolstatus;
        end if;
    end
    'LANGUAGE 'plpgsql'

    Code:
    select f_customerlogininfo('public', '09045612378', 'all');
    ERROR: SELECT query has no destination for result data;
  • michaelb
    Recognized Expert Contributor
    • Nov 2006
    • 534

    #2
    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.

    Comment

    • eros
      New Member
      • Jun 2007
      • 66

      #3
      Originally posted by michaelb
      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.

      Comment

      Working...