Re: store multiple rows with the SELECT INTO statement
От | Adrian Klaver |
---|---|
Тема | Re: store multiple rows with the SELECT INTO statement |
Дата | |
Msg-id | 5223E303.9070704@gmail.com обсуждение исходный текст |
Ответ на | store multiple rows with the SELECT INTO statement ("Janek Sendrowski" <janek12@web.de>) |
Список | pgsql-general |
On 09/01/2013 05:23 PM, Janek Sendrowski wrote: > Hi, > Why is it only possible to store one row by a query which returns > multiple rows using the SELECT INTO statement. > and > How can I do a Query on a record varialbe, somehow like this: > SELECT * FROM v_rec You can't a record variable can only hold a single row. FYI SELECT INTO in plpgsql is not the same as the SQL SELECT INTO: http://www.postgresql.org/docs/9.2/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-ONEROW Tip: Note that this interpretation of SELECT with INTO is quite different from PostgreSQL's regular SELECT INTO command, wherein the INTO target is a newly created table. If you want to create a table from a SELECT result inside a PL/pgSQL function, use the syntax CREATE TABLE ... AS SELECT. One way I have gotten around this to create a temporary table in the function and fill it with data and then select from it as suggested above. > Janek Sendrowski -- Adrian Klaver adrian.klaver@gmail.com
В списке pgsql-general по дате отправления: