in reply to skip empty mysql table
That said, I'm not sure what you are gaining in your example by creating smaller tables. If you have an index on the pat column, then it is not that less efficient to just query the main table and add a 'WHERE pat = ...' clause to restrict your query to what would be in the smaller table. Also, if you create the smaller tables, you'll have to update them whenever you update, insert or delete rows from the main table.
Finally, use placeholders!
my $a_sthexpt = $dbhexpt->prepare("CREATE TABLE TableNameexpt SEL +ECT * FROM final_exp WHERE pat = ?"); $a_sthexpt->execute($row[0]);
|
|---|