function with array parameter

Поиск
Список
Период
Сортировка
От Jean-Christophe Roux
Тема function with array parameter
Дата
Msg-id 20061108200724.43283.qmail@web35311.mail.mud.yahoo.com
обсуждение исходный текст
Ответы Re: function with array parameter
Список pgsql-php
Hello,
I have a function that I would like to call from a php script:

CREATE OR REPLACE FUNCTION a_dummy(arr_in text[])
  RETURNS text AS
$BODY$
declare
begin
    return arr_in[1];
end;
$BODY$
  LANGUAGE 'plpgsql' VOLATILE;

and the php code would be something like that
$arr;
$arr[0] = "one";
$arr[1] = 'two';
$query = "select func_a_dummy($arr)";
$result = pg_query($query);
echo pg_fetch_result($result, 0, 0);


but the syntax is wrong. Any idea what I should do to make it work
Thank you

В списке pgsql-php по дате отправления: