Re: best way to swap two records (computer details)

Поиск
Список
Период
Сортировка
От Michael Long
Тема Re: best way to swap two records (computer details)
Дата
Msg-id 52519.161.88.255.140.1111600785.squirrel@datalong.com
обсуждение исходный текст
Ответ на Re: best way to swap two records (computer details)  (Gary Stainburn <gary.stainburn@ringways.co.uk>)
Список pgsql-sql
> On Friday 18 March 2005 4:32 pm, you wrote:
>> How about a user defined function ???
>>
>> CREATE OR REPLACE FUNCTION harwareupdate(integer, integer) RETURNS
>> BOOLEAN AS '
>>
>>     update pieces set p_name = \'LSALES1\', p_location = \'Mike
>> Haley\', p_site = \'L\' where p_id = $1;
>>
>>     update pieces set p_name = \'SPARE\', p_location = \'spare\',
>> p_site = \'L\'
>>     where p_id = 2;
>>
>

Why not declare variables and select the current values into them and then update
the records with the appropriate values.



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

Предыдущее
От: Gary Stainburn
Дата:
Сообщение: Re: best way to swap two records (computer details)
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: [despammed] How do I do this?