Re: how to make a loop to do an insert for varchars

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Wed, 13 Oct 2010 06:58:39 +0200
Message-ID: <4cb53c87$0$27736$426a74cc_at_news.free.fr>


"John" <chunji08_at_gmail.com> a écrit dans le message de news: 4e595876-bcd7-4f57-a0f8-16f59be3f3c4_at_g18g2000yqk.googlegroups.com...
| Hi folks,
| let's say I want to do an insert of multiple rows, such as
| "
| insert into table ( id, column1 ) valuess ( idseq.nextval, 'abc');
| insert into table ( id, column1 ) valuess ( idseq.nextval, 'jfk');
| insert into table ( id, column1 ) valuess ( idseq.nextval, 'efg');
| insert into table ( id, column1 ) valuess ( idseq.nextval, 'bbc');
| insert into table ( id, column1 ) valuess ( idseq.nextval, 'bbb');
| insert into table ( id, column1 ) valuess ( idseq.nextval, 'xyz');
| ...
| "
|
| Is there a way I can do that in a for loop in oracle sql ?
|
|
| Thanks for the tips.
|
|
| John
|
|
|

If the data in the second column does not follow a rule (maybe the random one) how could you do it in a loop?

If you want to do it in a single statement, have a look at INSERT ALL.

Regards
Michel Received on Tue Oct 12 2010 - 23:58:39 CDT

Original text of this message