Hi, I am trying to read a file (Hebrew characters), and store data from it thought DBI into SQL server. Characters are garbaged after the Insert command. Any ideas?
Thanks Nicky Pappo [email protected] Here the relevant piece from the code: #!/usr/bin/perl use strict; use DBI; my $dbconnect="SQLEXPRESS"; #the odbc connection my $paramvalue = ""; my $filename="1"; my $paramtype="type"; my $sqlstatement; open(DAT, "test.txt" ) || die("Could not open file!"); binmode DAT, ":utf8"; while (<DAT>){ $paramvalue .= $_; } my $dbh = DBI->connect("dbi:ODBC:$dbconnect"); $sqlstatement= "insert into parameters (filename,ParameterType,ParameterValue) values('$filename','$paramtype',N'$paramvalue')"; #setUTF8($sqlstatement); my $sth = $dbh->prepare($sqlstatement); $sth->execute(); _______________________________________________ Perl mailing list [email protected] http://mail.perl.org.il/mailman/listinfo/perl
