Re: SELECT INTO Array?

Поиск
Список
Период
Сортировка
Искать
От
Sean Davis
Тема
Re: SELECT INTO Array?
Дата
Msg-id
001b01c53780$aefd13d0$5179f345@WATSON
Список
Дерево обсуждения
SELECT INTO Array? "Zitan Broth" <zitan@mediasculpt.net>
Re: SELECT INTO Array? Michael Fuhr <mike@fuhr.org>

----- Original Message ----- 
From: "Zitan Broth" 
To: "Michael Fuhr" 
Cc: 
Sent: Friday, April 01, 2005 9:00 PM
Subject: Re: [GENERAL] SELECT INTO Array?


> Hi Michael,
>
> Good question :-)
>
> I am writing a function that has a row of data passed into it as variables
> and an ID.  The function needs to pull out the appropriate row of data and
> compare each data item which those passed in.  For each found difference a
> log row is written somewhere else and if there are *any* differences the
> whole row is updated.
>
> I was building an array from the passed in parameters with ||, then I 
> wanted
> to build an array from a query (with SELECT INTO) and then compare each
> value with a loop:
>
> FOR i IN 1..17 LOOP
>      -- compare current with new data
>      if CurrentData[i] is not NewData[i] then
>       ChangeFound := true;
>       -- load change into log table
>
> Make sense?  Thanks again,

I think other folks hinted at this before, but you might consider using 
pl/perl or pl/python for this.  Array support and manipulation is more 
advanced in these languages than in pl/pgsql, at least for manipulation 
within the function.
> 


В списке pgsql-general по дате отправления
От: Poul Møller Hansen
Дата:
От: Hans-Jürgen Schönig
Дата:
Сообщение: Re: [HACKERS] plPHP in core?
FAQ