DBI problem inserting html into mssql db

From: Kristian (kristian_at_detandetfirma.dk)
Date: 11/13/03


Date: 13 Nov 2003 04:23:19 -0800

Hi Guys,
I have a script that has to insert an var containing a html string
into my microsoft sql server, and it keeps throwing the same error at
me.

DBD::ODBC::db do failed: [Microsoft][ODBC SQL Server Driver][SQL
Server]Line 89:
 Incorrect syntax near 'Tryk'. (SQL-42000)(DBD: Execute immediate
failed err=-1)
 at spider.pl line 175.

The 'Tryk' is part of the html string.
As far as I know, the problem is that I have to be able to handle
chars like æ,ø,å inside my html string. To cope with this problem I
have used the following:

use Unicode::String qw(utf8 latin1 utf16);
$vacancy = latin1( $html );
my $T = $vacancy->latin1;

$dbh -> do( qq{
UPDATE offer SET Description = '$T'
} ) or die "AARGGHH line 180 $DBI::errstr \n";

and this throws the error above at me constantly.

Regards

Kristian



Relevant Pages