From: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
---|---|
To: | Mario Alberto Soto Cordones <mario_soto(at)compuall(dot)cl> |
Cc: | <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: FUNCTION ERROR |
Date: | 2003-04-22 21:24:20 |
Message-ID: | 20030422141744.J72250-100000@megazone23.bigpanda.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Tue, 22 Apr 2003, Mario Alberto Soto Cordones wrote:
> Hi.
> i have a big problem with a function.
> i create a type unidades
> CREATE TYPE unidades AS (codigo numeric(3,0),
> descripcion text);
>
> and i create a function get_unidades
> CREATE FUNCTION get_unidades(int4, int4, int4, int4) RETURNS
> typeof
> unidades AS '
> SELECT cucoduni, cudesuni
> FROM cumauni
> WHERE cuempuni = $1 and
> cuseduni = $2 and
> cucaruni = $3 and
> cuasiuni= $4
> ; ' LANGUAGE 'sql';
>
> when execute this function
>
> select * from get_contenidos(10,1,15,17,31,12)
> as (codigo numeric(3,0),
> descripcion text)
>
> SAY
>
> ERROR: ExecMakeTableFunctionResult: Invalid result from function returning
> tuple
>
> ANY IDEA
It's hard to say since you're not calling the function you gave the
definition for, the function definition above isn't valid I think (I get
an error at unidades after making a table with appropriate columns -
fixable by replacing typeof with setof), and you didn't give the table
definition for the table in question.
From | Date | Subject | |
---|---|---|---|
Next Message | jack | 2003-04-23 02:33:07 | how to put an special code in a string |
Previous Message | Mario Alberto Soto Cordones | 2003-04-22 21:17:26 | FUNCTION ERROR |