> Now do I have to loop through the MySQL table seeing if I
> have to do an
> INSERT or an UPDATE? Any cool shorthand I can use to do this test?
How big is the table? i.e. if this is happening nightly, is it
prohibitively expensive to do this:
my $users_in_mysql = $mysql_dbh->selectall_hashref("SELECT ID FROM
SOME_TABLE", "ID");
while( ($first_name, $id) = $sel->fetch ) {
if( exists $users_in_mysql->{$id} ) {
# do update
} else {
# do insert
}
}
You might want to watch your user of fetchrow_hashref when you're grabbing
from Oracle. It's convenient but has added CPU cost.
It might also be easier to put all the users into a list using a fetch loop
rather than using the selectall_hashref above. Just an idea.
--
j.
James FitzGibbon voice/fax 612-761-6121/4277
Consultant, TTS-3D@TPN4H [EMAIL PROTECTED]