SRF problem - Mailing list pgsql-general

From Együd Csaba
Subject SRF problem
Date
Msg-id 001201c422bb$24cf2340$230a0a0a@compaq
Whole thread Raw
List 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
>


pgsql-general by date:

Previous
From: Együd Csaba
Date:
Subject: SRF problem
Next
From: Richard Huxton
Date:
Subject: Re: SRF problem