Re: calling stored procedure with array paramenter (for psql)

From: Assad Jarrahian <jarraa(at)gmail(dot)com>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: calling stored procedure with array paramenter (for psql)
Date: 2006-01-10 03:17:17
Message-ID: 4bd3e1480601091917m634e0ebcl9366d104ded4ce6a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

CREATE OR REPLACE FUNCTION getlms(_int4)
RETURNS SETOF tp_locationmessage_object AS
$BODY$
DECLARE
.......

SELECT * FROM getLMs(<what_goes_here>);

<what_goes_here> ... so lets say I want to send an array contain 1,23,34 ...

how do I do that .. whats the syntax?

On 1/9/06, Michael Fuhr <mike(at)fuhr(dot)org> wrote:
> On Mon, Jan 09, 2006 at 05:33:53PM -0700, Assad Jarrahian wrote:
> > I have a pg_psql stored procedure
> >
> > getlms(_int4)
> >
> > from psql
> >
> > SELECT * fROM get_lms(ARRAY[12,23,34]);
> >
> > that does not work. How do I pass an array to a function in psql?
>
> Could you explain what "does not work" means? Are you getting an
> error? If so, what's the error message?
>
> Are those the real function names? They don't match so that could
> be the problem (one is getlms, the other is get_lms). If that's
> not it then please post a simple but complete example.
>
> --
> Michael Fuhr
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2006-01-10 03:28:55 Re: Passing a list of values to a function
Previous Message Michael Fuhr 2006-01-10 01:45:54 Re: plpgsql question