From: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
---|---|
To: | Aldo Alexander Leyva Alvarado <aleyva2004(at)gmail(dot)com> |
Cc: | pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | Re: Problemita con array |
Date: | 2005-08-26 16:34:51 |
Message-ID: | 20050826163451.GA31254@surnet.cl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
On Fri, Aug 26, 2005 at 11:07:16AM -0500, Aldo Alexander Leyva Alvarado wrote:
> Mi pregunta es simple por que no me funciona esto
>
> DECLARE
>
> fila_metros RECORD;
> array_f_conteo date[];
>
> BEGIN
> count:=0;
> array_f_conteo[count]:=fila_metros.fecha_conteo;
> var_fecha_temp:=array_f_conteo[count];
> RAISE NOTICE ''FECHA %'', var_fecha_temp;
> END;
> El primer RAISE NOTICE que esta comentado, muestra la fecha sin problemas
> El Segungo MUESTRA NULL
Que version estas usando? En algunas versiones (7.4 creo), no funciona
el asignar valores a un elemento de un array NULL. Tienes que crear un
array no NULL (por ej. un array vacio) y luego puedes asignarle valores
a los elementos. Esto es un bug conocido.
En versiones mas recientes (8.0 creo), en la primera asignacion a un
array NULL, se crea la primera instancia del valor.
--
Alvaro Herrera (<alvherre[a]alvh.no-ip.org>)
Bob [Floyd] used to say that he was planning to get a Ph.D. by the "green
stamp method," namely by saving envelopes addressed to him as 'Dr. Floyd'.
After collecting 500 such letters, he mused, a university somewhere in
Arizona would probably grant him a degree. (Don Knuth)
From | Date | Subject | |
---|---|---|---|
Next Message | Aldo Alexander Leyva Alvarado | 2005-08-26 16:38:51 | Re: Problemita con array |
Previous Message | Alvaro Herrera | 2005-08-26 16:29:39 | Re: cambiar clave de BD |