Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: insert statement using a sequencer and query
I think you could get away with:
insert into table_name (seq_val, name_text, code) select name_id_seq.nextval, name_text, code from another_table);
regards,
Jonathan
On Mon, 13 Sep 1999 14:11:00 -0600, "Larry Pettit" <larry.pettit_at_ps.net> wrote:
>I'm trying to do an insert with the first column being a sequence value and
>the rest coming from another table. Is it possible and if so what is
>the correct syntax or do I need to use a cursor? I've already created the
>sequence name_id_seq.
>
>Thanks
>
> insert into table_name (seq_val, name_text, code)
> values(name_id_seq.nextval,
> (select name_text, code from another_table));
>
>
>
>
>
>
Received on Mon Sep 13 1999 - 17:06:46 CDT
![]() |
![]() |