View Single Post

   
  #2 (permalink)  
Old 04-09-2008, 06:56 PM
Decibel!
 
Posts: n/a
Default Re: Function with Integer array parameter

On Thu, Aug 16, 2007 at 11:14:25AM -0400, Ranjan Kumar Baisak wrote:
> Postgres Gurus,
> Please suggest me what is wrong with this
> function.
> This function tries to retrieve set of rows from description table based
> on set of ID fields passed as array.
>
> The error, I get is : ERROR: only one AS item needed for language "plpgsql"
>
> CREATE OR REPLACE function get_description_list(integer[]) RETURNS SETOF
> type_description AS
> 'DECLARE

...
> WHERE d_base.id in array_to_string(ints_desc_ids alias,',')


Note the quotes.

Use dollar quoting... it$$s your friend.
--
Decibel!, aka Jim Nasby decibel@decibel.org
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.3 (FreeBSD)

iD8DBQFGxHQCdO30qud8SkgRAhdiAJ4nddn5h3trSyrOJEOnEs 9LZjX2bQCgvaZM
+mUviOiEjoP9DP06uGkRX+c=
=vrSR
-----END PGP SIGNATURE-----

Reply With Quote