tags:

views:

91

answers:

0

I need to ensure that this LOAD query succeeded. How do I know inside my program it did not fail?

sub loaddata{
        my ($name) = @_;
        my $DBH = init_dbh( );
        my $STH_GO = $DBH->prepare(q{
                      LOAD DATA LOCAL INFILE '?' INTO TABLE authors FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n'; })or die "ERROR: ".       $DBI::errstr;
        $STH_GO->execute($name);

        }

This code is for inserting text file into database. I have to write a quality check code for this: if the data had written to database successfully then should come as output loaded successfully. If the data showing some error then should show data is invalid. I need a quality check code in my program.