Search Postgresql Archives

how to insert multiple rows and get the ids back in a temp table (pgplsql)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



how can I do the following in plpgsql?

insert multiple rows in a table

get the ids (serial) into a temp table (not the client)

 

for one row it will be like this

insert into mytable(mycolumn)values(123)returning id into some_variable;


now for multiple rows (using insert select) it will be like


insert into mytable(mycolumn)

select other_column from other_table

returning id into ???

 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux