There are a number of ways that I could do this. I would like to do it on the fly without printing to file. Am I on the right lines?
my $sthH= $dbh->prepare("SELECT code from Disease_Types") or die " +Couldn't prepare query: ".$dbh->errstr; $sthH->execute or die "Couldn't execute query: ".$sthG->errstr;; my @names =(); while (my ($name) = $sthH->fetchrow_array) { push @names, $name; } my @new_name = (); foreach (@names){ my $name = $_; my $cat_name = "A"."$name"; push @new_name, $cat_name; } #print @new_name; foreach (@new_name){ my $sthI = $dbh->prepare('INSERT into Disease_Types (Adapted_cod +e) Values ("$_")'); }
In reply to Inserting values in to table with DBI by Win
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |