From: | Együd Csaba <csegyud(at)vnet(dot)hu> |
---|---|
To: | "Pgsql-General(at)Postgresql(dot)Org (E-mail)" <pgsql-general(at)postgresql(dot)org> |
Subject: | SRF problem |
Date: | 2004-04-15 06:51:16 |
Message-ID: | 001101c422b6$0da117f0$230a0a0a@compaq |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Együd Csaba | 2004-04-15 07:27:44 | SRF problem |
Previous Message | Tom Lane | 2004-04-15 04:41:43 | Re: upgrading postgresql from 7.2 to 7.3, getting error |