SRF problem

From: Együd Csaba <csegyud(at)vnet(dot)hu>
To: pgsql-general(at)postgresql(dot)org
Subject: SRF problem
Date: 2004-04-15 07:27:44
Message-ID: 001201c422bb$24cf2340$230a0a0a@compaq
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

(Sorry if it arrives twice.)

>
> 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
>

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2004-04-15 07:30:42 Re: SRF problem
Previous Message Együd Csaba 2004-04-15 06:51:16 SRF problem