From: | Mario Wojcik <mariowojcik(at)yahoo(dot)com(dot)ar> |
---|---|
To: | 'Ayuda' <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Re: Error aleatorio |
Date: | 2009-08-11 18:05:55 |
Message-ID: | 4A81B303.5090506@yahoo.com.ar |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Fernando Hevia escribió:
>
>
>
>> -----Mensaje original-----
>> De: Mario Wojcik
>>
>> SELECT EXTRACT(MICROSECOND FROM LOCALTIME) INTO xgatime001;
>> xgatime001 es de tipo int.
>>
>
>
> La consulta devuelve un float pero lo almacenas en un integer.
> Aunque el cast implícito debiera funcionar por las dudas te diría que uses
> una variable float o hagas un cast a integer de la consulta, siendo lo más
> saludable lo primero.
>
> Ej:
>
> SELECT EXTRACT(MICROSECOND FROM LOCALTIME)::integer INTO xgatime001;
>
>
> Saludos,
> Fernando.
>
Bien, Vicente y Fernando, gracias por contrestar!
Use la funcion round en vez del cast
SELECT ROUND(EXTRACT(MICROSECOND FROM LOCALTIME)) INTO xgatime001;
Y hasta ahora no tuve mas problemas!
--
========================
WOJCIK, MARIO A.
========================
Leandro N Alem -Misiones
------------------------
A R G E N T I N A
------------------------
mariowojcik(at)yahoo(dot)com(dot)ar
From | Date | Subject | |
---|---|---|---|
Next Message | Miguel Espinoza | 2009-08-11 19:47:18 | Problema con instalación de postgresql 8.4.0.1 |
Previous Message | Edwin Quijada | 2009-08-11 16:46:25 | RE: funcion... |