Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Postgresql function return wrong value
Message
 
 
À
07/07/2016 16:27:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Application:
Desktop
Divers
Thread ID:
01638069
Message ID:
01638076
Vues:
59
I don't kinow anything about Postgres but I would try
SELECT max(data_fim_turno) as ultimo_fecho from turnos where produto=$1
>In PgAdmin III, If I execute;
>
>select data_ultimo_fecho('00001') as dia =>> return blank date
>
>and if I execute in PGAdmin III directely the line:
>
>SELECT max(data_fim_turno) as ultimo_fecho from turnos where produto='00001' =>> return correct value
>
>
>-- Function: data_ultimo_fecho(character)
>
>-- DROP FUNCTION data_ultimo_fecho(character);
>
>CREATE OR REPLACE FUNCTION data_ultimo_fecho(character)
> RETURNS date AS
>$BODY$SELECT max(data_fim_turno) as ultimo_fecho from turnos where produto='$1'$BODY$
> LANGUAGE sql VOLATILE
> COST 100;
>ALTER FUNCTION data_ultimo_fecho(character)
> OWNER TO aaaa_aaaaaa;
>
>Thanks in advance.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform