Re: "SQL" REPLACE SYNTAX

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: "SQL" REPLACE SYNTAX
Дата
Msg-id GNELIHDDFBOCMGBFGEFOOECHCBAA.chriskl@familyhealth.com.au
обсуждение исходный текст
Ответ на Re: "SQL" REPLACE SYNTAX  (Francisco Reyes <lists@natserv.com>)
Ответы Re: "SQL" REPLACE SYNTAX
Список pgsql-php
> Why so many? It is simple enough to attempt a delete and then do an
> insert.

DELETE WHERE what?  Alternatively you can attempt and update then do an
insert - question is UPDATE WHERE what?

If the insert fails you need to select from the postgres system catalogs to
find the primary key on the table (if there is one).  Next, you need to find
the fields that that primary key is defined over.  Next, you need to parse
the insert statement and find the fields being inserted that match the
primary key.  Lastly you need to modify the insert statment to an update
statment, take out the values that are part of the primary key and make them
part of the where clause of the update or delete statement.

Chris


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

Предыдущее
От: Francisco Reyes
Дата:
Сообщение: Re: Long running queries and timeouts
Следующее
От: Manuel Lemos
Дата:
Сообщение: Re: "SQL" REPLACE SYNTAX