can a insert with a returning clause be subquery ?

Поиск
Список
Период
Сортировка
Искать
От
chrisj
Тема
can a insert with a returning clause be subquery ?
Дата
Msg-id
15248628.post@talk.nabble.com
Список
Дерево обсуждения
can a insert with a returning clause be subquery ? chrisj <chrisj.wood@sympatico.ca>
Re: can a insert with a returning clause be subquery ? "Jonah H. Harris" <jonah.harris@gmail.com>
Re: can a insert with a returning clause be subquery ? Adrian Klaver <aklaver@comcast.net>
Re: can a insert with a returning clause be subquery ? "Jonah H. Harris" <jonah.harris@gmail.com>

I am trying to accomplish this:

update p2user.party set ADDR_KEY =   (insert into p2user.address ( street_no, street_name)                       values ('22', 'Geek St.')      returning addr_key )where party_key = 22 ;

But I am getting error:
ERROR:  syntax error at or near "into"
LINE 1: update p2user.party set ADDR_KEY = (insert into p2user.addre...                                                  ^(is actually under the
"into")

The insert by itself works fine and returns a valid integer.

I know I could do this easily with a stored proc,but it seems like an obvious use of the returning clause

Am I missing some syntax error


-- 
View this message in context: http://www.nabble.com/can-a-insert-with-a-returning-clause-be-subquery---tp15248628p15248628.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.


В списке pgsql-sql по дате отправления
От: Marcin Krawczyk
Дата:
Сообщение: Re: aggregate reverse
От: Jonah H. Harris
Дата:
FAQ