#!/usr/bin/perl
use DBI;
use Data::Dumper;
use strict;
my $DSN = q/dbi:ODBC:SQLSERVER/;
my $uid = q/username/;
my $pwd = q/password/;
my $first_param=723454;
my $current_date="2012-10-25 00:30:21";
my $after_2min="2012-10-25 05:47:41";
my $dbh = DBI->connect($DSN,$uid,$pwd) or die "Coudn't Connect SQL";
my $sql2 = "insert reverise_call_main_menu call_number,call_originate_time,call_inbetween_time,call_after_2min_time) values(?,?,?,?)";
my $sth2 = $dbh->prepare($sql2);
$sth2->execute($first_param,$current_date,'null',$after_2min);
$sth2->finish;
$dbh->disconnect;
每当我执行程序时,我都会遇到以下错误:
输出: -
DBD :: ODBC :: st执行失败:[unixODBC] [FreeTDS] [SQL Server]从字符串转换datetime时转换失败。 (SQL-22007)