| От | Brian Hurt |
|---|---|
| Тема | Re: How do I insert a record into a table? |
| Дата | |
| Msg-id | 466079C3.9020106@janestcapital.com обсуждение исходный текст |
| Ответ на | Re: How do I insert a record into a table? (Richard Broersma Jr <rabroersma@yahoo.com>) |
| Список | pgsql-novice |
The same. Note that I defined func to return type table.--- Brian Hurt <bhurt@janestcapital.com> wrote:I want to write a query like: INSERT INTO table SELECT func(args); where func is defined as: CREATE OR REPLACE FUNCTION func(args) RETURNS table AS $_$ ... $_$ LANGUAGE plpgsql; Unfortunately, when I try to do this, I get: ERROR: column "first_column" is of type integer but expression is of type record I get this error even if I list the columns: INSTER INTO table(first_column, second_column, ...) .... So how do I take a record returned from a function, and insert it as a row into a table?What does a select * from table; look like? What does a select * from func(args); look like?
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера