Hola, Luis. El mensaje de error es claro: estás devolviendo un bigint y un text, no un registro de tipo AuditoriaCatastro. Devuelve "SETOF RECORD" en su lugar.

    Saludos,

    Álvaro



--
Álvaro Hernández Tortosa


-----------
NOSYS
Networked Open SYStems



El 25/08/11 21:32, luis antony meza alania escribió:
hola amigos quiero q me ayuden con este codigo

CREATE OR REPLACE FUNCTION auditoria_fichas(fecha date,codper text)
RETURNS SETOF "AuditoriaCatastro"
AS
$$
SELECT count(*),"CodPersonal"
FROM "AuditoriaCatastro"
where "TableName"='TI_Unicat' and "Operation"='INSERT' and "NewValue" not in (select "OldValue" from "AuditoriaCatastro" where "Operation"='DELETE') and extract(hour from "UpdateDate") between 8 and 16 and cast(to_char("UpdateDate",'YYYY-MM-DD') as date)='2011-08-25'
group by "CodPersonal"

$$
LANGUAGE SQL;

me sale un error
 que esto :
ERROR: el tipo de retorno de función declarada para retornar "AuditoriaCatastro" no concuerda DETAIL: La sentencia final retorna bigint en lugar de integer en la columna 1.
CONTEXT:  función SQL «auditoria_fichas»

********** Error **********

ERROR: el tipo de retorno de función declarada para retornar "AuditoriaCatastro" no concuerda
SQL state: 42P13
Detail: La sentencia final retorna bigint en lugar de integer en la columna 1.
Context: función SQL «auditoria_fichas»

quiero q me den la solucion
bueno saludos!!!

Responder a