my $fields = join(', ', @cols); my $values = join(', ', @rows); $sql02 = qq{"INSERT INTO DATA__WAREHOUSE($cols) VALUES ($rows)"};
Shouldn't $sql02 be using $fields and $values instead of $cols and $rows? And why not just grab the column names from $sth->{NAME} after a dummy search like WHERE 1=0?
-- Jeff
