sub bcpInsert { my ($table, $_rows) = @_; # configure BCP for the push BCP_SETL(TRUE); my $bcp = new Sybase::BCP $user, $pass, $server; $bcp -> bcp_init($table, "", "", DB_IN); $bcp -> bcp_meminit((1 + $#{@$_rows[0]})); # perform the db upload my $count; foreach my $row (@$_rows) { $bcp -> bcp_sendrow($row); $bcp -> bcp_batch unless (++$count % 100); # commit every 100 rows } $bcp -> bcp_batch; # commit the last batch of data $bcp -> bcp_done; warn "Debugging: bcpInsert returning ..\n"; } #### # build an array of arrays for BCP to upload &bcpInsert("custdata", \@data); print "Upload complete\n";