in reply to Error passing string date from Perl to MSSQL
What's wrong with simply adding the required single quotes?
my $sql = "INSERT INTO TableName(Date,FileName) VALUES('$Date',$file)" +;
Or even better, use DBI placeholders:
my $sql = 'INSERT INTO TableName(Date,FileName) VALUES(?,?)'; my $stmt = $settle_dbh->prepare($sql); $stmt->execute($Date, $file); # no quoting needed
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Error passing string date from Perl to MSSQL
by JobyJ (Initiate) on Apr 20, 2017 at 09:03 UTC | |
by Corion (Patriarch) on Apr 20, 2017 at 09:05 UTC | |
by MidLifeXis (Monsignor) on Apr 20, 2017 at 17:28 UTC | |
by chacham (Prior) on Apr 20, 2017 at 18:34 UTC | |
by cormanaz (Deacon) on Apr 20, 2017 at 18:01 UTC |