Trace: DBI 1.616-ithread default trace level set to 0x0/2 (pid 2892 pi 32bb4) at db_eval_test.pl line 42 via db_eval_test.pl line 40 !! info: '' CLEARED by call to prepare method -> prepare for DBD::ODBC::db (DBI::db=HASH(0x26f2e0c)~0x26f2d7c 'INSERT INTO RecordCount VALUES (?,?,?,?,?,?)') thr#32bb4 <- prepare= ( DBI::st=HASH(0x26f303c) ) [1 items] at db_eval_test.pl line 51 -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x26f303c)~0x26f2ffc 1 'SMOKE\service-test') thr#32bb4 <- bind_param= ( 1 ) [1 items] at db_eval_test.pl line 52 -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x26f303c)~0x26f2ffc 2 'TEST') thr#32bb4 <- bind_param= ( 1 ) [1 items] at db_eval_test.pl line 53 -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x26f303c)~0x26f2ffc 3 '2013081107999999test') thr#32bb4 <- bind_param= ( 1 ) [1 items] at db_eval_test.pl line 54 -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x26f303c)~0x26f2ffc 4 'test_file') thr#32bb4 <- bind_param= ( 1 ) [1 items] at db_eval_test.pl line 55 -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x26f303c)~0x26f2ffc 5 '2014-08-12 16:6:45.584') thr#32bb4 <- bind_param= ( 1 ) [1 items] at db_eval_test.pl line 56 -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x26f303c)~0x26f2ffc 6 22) thr#32bb4 <- bind_param= ( 1 ) [1 items] at db_eval_test.pl line 57 -> execute for DBD::ODBC::st (DBI::st=HASH(0x26f303c)~0x26f2ffc) thr#32bb4 !! ERROR: 1 '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification (SQL-22018)' (err#1) <- execute= ( undef ) [1 items] at db_eval_test.pl line 59 !! ERROR: 1 CLEARED by call to disconnect method -> disconnect for DBD::ODBC::db (DBI::db=HASH(0x26f2e0c)~0x26f2d7c) thr#32bb4 <- disconnect= ( 1 ) [1 items] at db_eval_test.pl line 60 -> DESTROY for DBD::ODBC::st (DBI::st=HASH(0x26f2ffc)~INNER) thr#32bb4 <- DESTROY= ( undef ) [1 items] at db_eval_test.pl line 40 -> DESTROY for DBD::ODBC::db (DBI::db=HASH(0x26f2d7c)~INNER) thr#32bb4 <- DESTROY= ( undef ) [1 items] at db_eval_test.pl line 40 -- DBI::END ($@: , $!: ) !! info: '' CLEARED by call to disconnect_all method -> disconnect_all for DBD::ODBC::dr (DBI::dr=HASH(0x26f287c)~0x26f28fc) thr#32bb4 <- disconnect_all= ( '' ) [1 items] at DBI.pm line 744 ! -> DESTROY in DBD::_::common for DBD::ODBC::dr (DBI::dr=HASH(0x26f28fc)~INNER) thr#32bb4 ! <- DESTROY= ( undef ) [1 items] during global destruction #### use strict; use warnings; use DBI; use Time::HiRes qw/gettimeofday/; use Win32::ODBC; my @timedata = localtime(); my $sec = $timedata[0]; $sec = '0'.$sec if $sec <10; my $min = $timedata[1]; $min = '0'.$min if $min <10; my $hour = $timedata[2]; $hour = '0'.$hour if $hour <10; my $day = $timedata[3]; my $month = $timedata[4]+1; $month = '0'.$month if $month < 10; my $year = $timedata[5]+1900; (my $seconds, my $ms) = gettimeofday(); $ms = ($ms-($ms%1000))/1000; my $time = $hour.":".$min.":".$sec.".".$ms; my $date = $year."-".$month."-".$day; my $temp_date = $date.' '.$time; my $server_name = 'SMKAPP'; my $database_name = 'TESTDATA'; my $database_user = ''; my $database_pass = ''; my $env = 'SMOKE\\service-test'; my $partner = 'TEST'; my $msgid = '2013081107999999test'; my $DB_insert ='true'; my $filename = 'test_file'; my $line_count = 22; if($DB_insert =~ /true/i) { my $DSN = "driver={SQL Server};server=$server_name;database=$database_name;uid=$database_user;pwd=$database_pass;"; eval { my $dbh = DBI->connect("dbi:ODBC:$DSN"); DBI->trace(2,'C:\db_test_log3.txt'); my $sql = "INSERT INTO RecordCount VALUES (?,?,?,?,?,?)"; my $sth = $dbh->prepare($sql); $sth->bind_param(1, $env); $sth->bind_param(2, $partner); $sth->bind_param(3, $id); $sth->bind_param(4, $filename); $sth->bind_param(5, $temp_date); $sth->bind_param(6, $line_count); $sth->execute(); $dbh->disconnect(); }; if($@) { print "DB Failure: $@"; } } exit 0;