Get id of a tuple using exception

Поиск
Список
Период
Сортировка
От f vf
Тема Get id of a tuple using exception
Дата
Msg-id BANLkTik0fUKBcdYEnFeLczA0e6Gmt-3D=g@mail.gmail.com
обсуждение исходный текст
Ответы Re: Get id of a tuple using exception
Список pgsql-sql
Hello,<br />i'm using a pl/sql procedure and I prevent inserting duplicate tuples using an exception for example:<br
/><br/>  BEGIN<br />       INSERT INTO "Triples"(id, subject, predicate, "object") <br />                    VALUES
(id,sub_i, pred_i, obj_i);<br /><b> EXCEPTION WHEN unique_violation THEN<br />                --do something.<br /><br
/></b>Insome cases I have interest in getting the id of the tuple that was already in the table when the exception is
triggered.Is there a way for the EXCEPTION to return that id instead of using a select to know wich was the id of the
triplealready existing in the table?<br /><br />Thanks, <br />Filipe<br /> 

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

Предыдущее
От: "Volkmar Herbst GCI"
Дата:
Сообщение: strange update behavior
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Get id of a tuple using exception