Re: Array variables y/o redimensionables

From: Calabaza <calalinux(at)gmail(dot)com>
To: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Array variables y/o redimensionables
Date: 2008-05-22 12:42:49
Message-ID: 958993320805220542q74e7a29bu614369e7927db8c9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

2008/5/22 Fernando Aguada <fernandoaguada(at)yahoo(dot)com(dot)ar>:
> Hola,
> alguien conoce como definir un array de dimensiones variables?,

Hola amigo, mi ingles no es tan bueno, pero leyendo el manual[1],
en la seccion: 8.14.1. Declaration of Array Types dice algo así:

*However, the current implementation does not enforce the array size
limits — the behavior is the same as for arrays of unspecified
length.*

* De modo que, la implementación actual no impone limites a los array,
-el comportamiento es el mismo como para los arrays de longitud sin
especificar.*

puedes darte una vuelta por:

[1]http://www.postgresql.org/docs/8.3/interactive/arrays.html
[2]http://www.postgresql.org/docs/8.3/interactive/sql-expressions.html#SQL-SYNTAX-ARRAY-CONSTRUCTORS

> este
> pedazo de codigo que pongo a continuacion
> no funciona,

> ademas se pueden redimensionar un array?

Puedes mirar esto tambien:[1]

* An array subscript expression will return null if either the array
itself or any of the subscript expressions are null. Also, null is
returned if a subscript is outside the array bounds (this case does
not raise an error). For example, if schedule currently has the
dimensions [1:3][1:2] then referencing schedule[3][3] yields NULL.
Similarly, an array reference with the wrong number of subscripts
yields a null rather than an error.*

> select count(*) into wcanimp from servicioscuentasimpuestos where
> cidencta=rcuentas.cidencta and cservi=1 and cmodo=2;

> declare warray numeric [wcanimp];

Creo, que si esto es para una función, el declare va luego del begin,
y sería así:

declare wcanimp numeric[]

> Saludos Cordiales

Un abrazo, y a ver si te sirvio lo antes dicho.
--
§~^Calabaza^~§ from Villa Elisa, Paraguay

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Fernando Aguada 2008-05-22 13:21:40 Re: Array variables y/o redimensionables
Previous Message Fernando Aguada 2008-05-22 11:43:10 Array variables y/o redimensionables