replace??

Поиск
Список
Период
Сортировка
От bboett@erm1.u-strasbg.fr (Bruno Boettcher)
Тема replace??
Дата
Msg-id 20001219133752.C9283@erm1.u-strasbg.fr
обсуждение исходный текст
Ответы Re: replace??  ("Brett W. McCoy" <bmccoy@chapelperilous.net>)
Список pgsql-sql
hello,

i have the following problem:
i have in php an array structure with user-prefs that have to be stored
onto DB....

actually i look up if the corresponding entry exists (comparing
user-name and field-name) if yes i update, if no i insert....

this isn't very appealing, but i couldn't find another way yet to make
this shorter...

would be nice if something like the following existed:

replace settings set auser='toto',field='lang',data='fr' where
auser='toto' and field='lang';

update settings set auser='toto',field='lang',data='fr' where
auser='toto' and field='lang' REPLACE;

or even better:

replace settings keys(auser,field) set auser='toto',field='lang',data='fr';


-- 
ciao bboett
==============================================================
bboett@earthling.net
http://inforezo.u-strasbg.fr/~bboett http://erm1.u-strasbg.fr/~bboett
===============================================================
the total amount of intelligence on earth is constant.
human population is growing....


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

Предыдущее
От: Tulassay Zsolt
Дата:
Сообщение: Re: Tree structure table normalization problem (do I need a trigger?)
Следующее
От: "Brett W. McCoy"
Дата:
Сообщение: Re: replace??