in reply to $hour_insert_sth->execute showing error

Hi ravi45722,

Yes, this is a not very informative message from MySQL. You can help by placing

DBI->trace(2);
in your script; this will print out a lot of information including the actual SQL passed to MySQL, which will probably help you spot your problem. See DBI TRACING.

Your error is probably not caused by the string value in $system_id: your use of placeholders makes quoting the values you are going to pass to the DBI unnecessary.

Also note that since you are passing the RaiseError attribute you don't need the or die $DBI::errstr after your calls to your DBI methods.

Hope this helps!

The way forward always starts with a minimal test.