in reply to DBI Insert

Yes.

Oh wait, did you want to know what the problem is?

Read the DBI docs. You'll find there that the method do() is used on a database handle - in this case, that's your $dbh. Thus you need to do this:

my $sql = "INSERT into 1985_onwards_slim_I (Year_of_death, Ageyears, Sex, Undcause, OAcode) SELECT Col003, Col020, Col023, Col029, Col051 from 1985_onwards_full_data_set"; $dbh->do($sql);

If you want to prepare and execute, the sequence is like this:

my $sth = $dbh->prepare($sql); $sth->execute();

Also, I recommend some Error-checking - always a plus.

--
3dan