SRF problem - Mailing list pgsql-general

From Együd Csaba
Subject SRF problem
Date
Msg-id 001101c422b6$0da117f0$230a0a0a@compaq
Whole thread Raw
Responses Re: SRF problem
Re: SRF problem
Re: SRF problem
List pgsql-general
Hi All,
I'd like to write an SRF but I'm block a strange error message

WARNING:  plpgsql: ERROR during compile of check_close2 near line 11
ERROR:  return type mismatch in function returning tuple at or near ";"

I get this message even if the return rowset contains 0 or more tuples. What
is done wrong?
The code:
-----------------------------------------------------------------
create type CHECK_CLOSE as (
  prooftype       text,
  id              int,
  sn              text,
  partnername     text,
  performancedate text,
  detailcount     int
);
------------------------------------------------------------------
create or replace function check_close2() returns CHECK_CLOSE AS '
declare
  R       CHECK_CLOSE%ROWTYPE;
begin
  R.prooftype       := ''INCINV'';
  R.id              := 1;
  R.sn              := ''012334'';
  R.partnername     := ''someone'';
  R.performancedate := ''2004.02.01'';
  R.detailcount     := 0;
  return next R;
  return;
end;'
language 'plpgsql';
------------------------------------------------------------------
select * from check_close2();
WARNING:  plpgsql: ERROR during compile of check_close2 near line 11
ERROR:  return type mismatch in function returning tuple at or near ";"


Thank you very much.
-- Csaba Együd


pgsql-general by date:

Previous
From: David Wheeler
Date:
Subject: Re: pg_autovacuum won't make on FreeBSD
Next
From: Együd Csaba
Date:
Subject: SRF problem