| From: | "Fernando Aguada" <fernandoaguada(at)yahoo(dot)com(dot)ar> | 
|---|---|
| To: | <pgsql-es-ayuda-postgresql(dot)org(at)postgresql(dot)org> | 
| Subject: | Poblema con Crystal Reports al llamar a una funcion | 
| Date: | 2006-11-04 23:03:23 | 
| Message-ID: | 000001c7006d$4b3c5970$6400a8c0@serverfa | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-es-ayuda | 
Saludos,
               estoy intentando llamar a una funcion desde crystal reports (9) a una funcion en postgresql 8.1
y ni siquiera puedo llegar a grabar la instruccion en crystal, sin embargo desde el analizador de consultas
de PGadmin funciona perfecto.
El mensaje de error es el siguiente (de Crystal):
Failed to open rowset.
Details:function chequesprescta(integer,date,date,integer,integer) does not exist
La llamada a la funcion desde el crystal es la siguiente:
select * from chequesprescta({?w1orden},{?w2defec},{?w2hafec},{?w3deban},{?w4empre})
mientras que la funcion es esta:
CREATE OR REPLACE FUNCTION chequesprescta(worden int2, wdefec date, whafec date, wdeban int2, wempre int2)
  RETURNS SETOF chequesprescta AS
$BODY$declare rchequesp chequesprescta%ROWTYPE;
begin
  for rchequesp in SELECT  
      sum(case cimpu 
      when 1 then cneto*-01 
      when 2 then cneto*+01 
      when 3 then cneto*-01 
      when 4 then cneto*+01
      end) as cneto,
      'SAL' as cabre,
      'Saldo Inicial' as cconce,
      0 as cnuch,
      wdefec as cfech
      from chequesp where cfech< wdefec and cbanc=wdeban and cempre=wempre
      group by cbanc 
      union 
      select 
      cneto*(case chequesp.cimpu
      when 1 then -01
      when 2 then +01
      when 3 then -01
      when 4 then +01
      end),tipocomp.cabre,cconce,cnuch,cfech from chequesp
      left join tipocomp on ctipo=tipocomp.cnume
      where cfech>=wdefec and cfech<=whafec and cempre=wempre
      and cbanc=wdeban 
      loop
      return next rchequesp;
end loop;
return;
end
$BODY$
  LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION chequesprescta(worden int2, wdefec date, whafec date, wdeban int2, wempre int2) OWNER TO postgres;
GRANT EXECUTE ON FUNCTION chequesprescta(worden int2, wdefec date, whafec date, wdeban int2, wempre int2) TO public;
GRANT EXECUTE ON FUNCTION chequesprescta(worden int2, wdefec date, whafec date, wdeban int2, wempre int2) TO postgres;
GRANT EXECUTE ON FUNCTION chequesprescta(worden int2, wdefec date, whafec date, wdeban int2, wempre int2) TO operadores;
CUALQUIER SUGERENCIA MUY AGRADECIDO.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Gunnar Wolf | 2006-11-05 02:34:44 | Re: Seguridad en PostgreSQL | 
| Previous Message | Juan Martínez | 2006-11-04 21:53:31 | Re: Seguridad en PostgreSQL |