Re: working with arrays inside a plpgsql function - Mailing list pgsql-novice

From Andreas Kretschmer
Subject Re: working with arrays inside a plpgsql function
Date
Msg-id 20070215160656.GA7909@KanotixBox
Whole thread Raw
In response to working with arrays inside a plpgsql function  ("Luis Silva" <lfs12@hotmail.com>)
Responses Re: working with arrays inside a plpgsql function
List pgsql-novice
Luis Silva <lfs12@hotmail.com> schrieb:

> Hi all!
>
> I'm trying to use array inside a pl/pgsql function and I'm having some
> problems using the all array at the same time. Let me give you an example:
>
> ident text[];
>
> BEGIN
>
> ident = $1;  -- $1 is a array argument from the plpgsql function
> EXECUTE 'SELECT count(identity) FROM public_data WHERE identity IN ||ident
> INTO asds;

At least a missing ' between IN and ||.


> PS - How can I retrieved the size ofthe array? I saw the manual and I
> couldn't find it.

array_dims(), array_lower(), array_upper()
http://www.postgresql.org/docs/8.1/interactive/functions-array.html


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

pgsql-novice by date:

Previous
From: "Luis Silva"
Date:
Subject: working with arrays inside a plpgsql function
Next
From: "Luis Silva"
Date:
Subject: Re: working with arrays inside a plpgsql function