insert values from a ROW object
insert values from a ROW object
От:
Michael Moore <michaeljmoore@gmail.com>
Дата:
for a in select * from temp_rslt
loop
insert into final_rslt select row(a.*);
end loop;
I want to do something like the above. I don't want to have to name each 'a.' variable.
Is it possible?
TIA
Mike
Re: insert values from a ROW object
От:
Michael Moore <michaeljmoore@gmail.com>
Дата:
by the way, the row structure of temp_rslt and final_rslt are identical.
On Thu, Sep 22, 2016 at 2:42 PM, Michael Moore <michaeljmoore@gmail.com> wrote:
for a in select * from temp_rsltloopinsert into final_rslt select row(a.*);end loop;I want to do something like the above. I don't want to have to name each 'a.' variable.Is it possible?TIAMike
Re: insert values from a ROW object
От:
"David G. Johnston" <david.g.johnston@gmail.com>
Дата:
for a in select * from temp_rsltloopinsert into final_rslt select row(a.*);end loop;I want to do something like the above. I don't want to have to name each 'a.' variable.Is it possible?
INSERT INTO final_rslt VALUES ( (a).* );
David J.
Re: insert values from a ROW object
От:
Thomas Kellerer <spam_eater@gmx.net>
Дата:
Michael Moore schrieb am 22.09.2016 um 23:42: > for a in select * from temp_rslt > loop > insert into final_rslt select row(a.*); > end loop; > > I want to do something like the above. I don't want to have to name each 'a.' variable. > Is it possible? > No need for a loop: insert into final_rsl select * from tmp_rslt; This assumes that both table define the columns in the exact same order
Re: insert values from a ROW object
От:
Michael Moore <michaeljmoore@gmail.com>
Дата:
Thanks David.
Thomas, Yes, in my example the loop is not necessary, but in my real application it is. :-) Thanks.
On Thu, Sep 22, 2016 at 2:55 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
for a in select * from temp_rsltloopinsert into final_rslt select row(a.*);end loop;I want to do something like the above. I don't want to have to name each 'a.' variable.Is it possible?INSERT INTO final_rslt VALUES ( (a).* );David J.