funeralcrasher: (Default)
funeralcrasher ([personal profile] funeralcrasher) wrote2007-09-09 03:02 pm

Oracle, or why am I working today.

Is there a way to INSERT SELECT into a table with an auto-increment field?

INSERT INTO t_peep
 SELECT population, name FROM cia
  WHERE region='Europe';

Where I'd normally have to do something like

INSERT INTO t_peep (id, population, name) VALUES (blah_sequence.nextval, '$population', '$name');