Skip site navigation (1) Skip section navigation (2)

BUG #2914: SELECT query has no destination for result data

From: "prasad" <prasad05_qs(at)yahoo(dot)co(dot)in>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2914: SELECT query has no destination for result data
Date: 2007-01-20 05:12:19
Message-ID: 200701200512.l0K5CJWJ026327@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2914
Logged by:          prasad
Email address:      prasad05_qs(at)yahoo(dot)co(dot)in
PostgreSQL version: 8.1
Operating system:   windows
Description:        SELECT query has no destination for result data
Details: 

hi...

i'm created a function

-- Function: "Get_Inbox"("Message_Posted_To" "varchar", "Message_Posted_By"
"varchar")

-- DROP FUNCTION "Get_Inbox"("Message_Posted_To" "varchar",
"Message_Posted_By" "varchar");

CREATE OR REPLACE FUNCTION "Get_Inbox"("Message_Posted_To" "varchar",
"Message_Posted_By" "varchar")
  RETURNS SETOF "vw_getAllMessages" AS
$BODY$DECLARE
	Message_Inbox_Type alias for $2;
BEGIN
IF Message_Inbox_Type = ' ' OR Message_Inbox_Type = null THEN
Select * 
from "vw_getAllMessages" 
where "Message_Posted_To" = $1 
order by "Message_ID" desc;
ELSE
Select * 
from "vw_getAllMessages" 
where "Message_Posted_To" = $1 
and "Message_Posted_By" = Message_Inbox_Type 
order by "Message_ID" desc;
END IF;
END;$BODY$
  LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION "Get_Inbox"("Message_Posted_To" "varchar",
"Message_Posted_By" "varchar") OWNER TO postgres;


where vw_getAllMessages is view which i created using

CREATE OR REPLACE VIEW "vw_getAllMessages" AS 
 SELECT "Messages"."Message_ID", "Messages"."Message_Text",
"Messages"."Message_Date", ("Client"."Client_First_Name"::text || ' '::text)
|| "Client"."Client_Last_Name"::text AS "Sender Name",
("Portfolio_Manager"."PM_User_Name"::text || ' '::text) ||
"Portfolio_Manager"."PM_Last_Name"::text AS "Receiver Name",
"Messages"."Message_Posted_By", "Messages"."Message_Posted_To",
"Messages"."Message_Context", "Messages"."Message_Reply_To",
"Messages"."Message_Replied_Date", "Messages"."Message_Subject",
"Messages"."Message_InboxReadFlag", "Messages"."Message_SentReadFlag",
"Messages"."Message_Inbox_DeleteFlag", "Messages"."Message_Sent_DeleteFlag"
   FROM "Messages"
   JOIN "Client" ON "Messages"."Message_Posted_By"::text =
"Client"."Client_Depository_Client_ID"::text
   JOIN "Portfolio_Manager" ON "Messages"."Message_Posted_To"::text =
"Portfolio_Manager"."PM_Registration_No"::text
  ORDER BY "Messages"."Message_ID" DESC;

ALTER TABLE "vw_getAllMessages" OWNER TO postgres;

when i do
Select * From "Get_Inbox"('INC00000000',' ');
or
select * from "Get_Inbox"('INC00000000', '11111')

i get error

ERROR:  SELECT query has no destination for result data
HINT:  If you want to discard the results, use PERFORM instead.
CONTEXT:  PL/pgSQL function "Get_Inbox" line 5 at SQL statement

pls help me as soon as posible......

Responses

pgsql-bugs by date

Next:From: Adriaan van OsDate: 2007-01-20 09:20:52
Subject: Re: BUG #2907: pg_get_serial_sequence quoting
Previous:From: Tom LaneDate: 2007-01-20 05:03:01
Subject: Re: BUG #2907: pg_get_serial_sequence quoting

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group