Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > DBI problem inserting html into mssql db

Reply
Thread Tools

DBI problem inserting html into mssql db

 
 
Kristian
Guest
Posts: n/a
 
      11-13-2003
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions on DBI::ADO stored procedures and inserts mssql server lrlebron@gmail.com Ruby 1 12-19-2006 05:42 PM
Problem with inserting date value into MSSQL Igal ASP General 2 11-20-2006 10:22 AM
mssql's PRINT command and DBI's .execute method rpardee@comcast.net Ruby 0 08-26-2005 09:33 PM
DBI::ADO problem... execute() doesn't return valid rows from MSSQL doug Perl Misc 1 06-07-2005 09:27 AM
dbi -> sqlrelay -> mssql performance Raphael Bauduin Ruby 1 07-01-2003 11:52 AM



Advertisments