title: PostgreSQL error: query has no destination for result data
body: <p>Trying to get into PostgreSQL.
  I'm drawing an function that will check credentials</p>
  
  <p>Here is it:</p>
  
  <pre><code>CREATE or REPLACE  FUNCTION CkeckUser (Login varchar(50), Password varchar(50)) 
  RETURNS TABLE(ID int, IDParent int, Text varchar(50), Image bytea, DLLName varchar(50), MethodName varchar(50), Parameters varchar(250) )
   AS $$
  DECLARE
    idu INT;
  BEGIN
  
  idu := null;
  
   select idu = u."ID"
   FROM  "Users" u
   where (u."Login" = $1) and (u."Password" = $2);
  
    select 
  utm."IDMenuItem" as ID,
  utm."IDParentMenuItem" as IDParent,
  m."Text",
  m."Image",
  m."DLLName",
  m."MethodName",
  m."Parameters"
      from        "Users" u
              join "UserTypes" ut on u."Type" = ut."ID"
              join "UserTypeMenu" utm on u."Type" = utm."IDUserType"
              join "Menu" m on utm."IDMenuItem" = m."ID";
  where u."ID" = IDU;
  order by m."ID";
  
  END; $$
   LANGUAGE 'plpgsql';
  </code></pre>
  
  <p>Logics is pretty simple but on executing it</p>
  
  <pre><code> select CkeckUser(N'admin', N'test');
  </code></pre>
  
  <p>or</p>
  
  <pre><code>  select * from CkeckUser(N'admin', N'test');
  </code></pre>
  
  <p>I got </p>
  
  <pre><code>  ERROR:  query has no destination for result data
  </code></pre>
  
  <p>where I'm wrong?</p>