Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Postgresql function return wrong value
Message
 
 
To
07/07/2016 16:27:48
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Application:
Desktop
Miscellaneous
Thread ID:
01638069
Message ID:
01638076
Views:
54
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--
Previous
Reply
Map
View

Click here to load this message in the networking platform