my $hour_master_db = DBI->connect("DBI:mysql:database=$database;host=$host;mysql_socket=/opt/lampstack-5.5.27-0/mysql/tmp/mysql.sock","root","", {'RaiseError' => 1}); my $hour_insert_sth = $hour_master_db->prepare("insert into esme_hourly_master values(?,?,?,?,?,?,?,?,?,now(),'MIS'"); $hour_insert_sth->execute($hr,$date,$system_id,$total_sub_data{$statsdate}{$system_id},$totalacpt_data{$statsdate}{$system_id},$total_rej_data{$statsdate}{$system_id},$del_data{$statsdate}{$system_id},$undel_data{$statsdate}{$system_id},$exp_data{$statsdate}{$system_id}) or die $DBI::errstr; #### DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 at final.pl line 328. DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 at final.pl line 328. #### +---------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+-------------+------+-----+---------+-------+ | hour | int(2) | NO | PRI | NULL | | | day | date | NO | PRI | NULL | | | system_id | varchar(21) | NO | PRI | | | | submitted | bigint(20) | NO | | 0 | | | accepted | bigint(20) | NO | | 0 | | | rejected | bigint(20) | NO | | 0 | | | delivered | bigint(20) | NO | | 0 | | | undelivered | bigint(20) | NO | | 0 | | | expired | bigint(20) | NO | | 0 | | | creation_date | datetime | NO | | NULL | | | created_by | varchar(20) | NO | | | | +---------------+-------------+------+-----+---------+-------+ 11 rows in set (0.00 sec)