DBI problem inserting html into mssql db

Discussion in 'Perl' started by Kristian, Nov 13, 2003.

  1. Kristian

    Kristian Guest

    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
     
    Kristian, Nov 13, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Igal
    Replies:
    2
    Views:
    275
  2. Raphael Bauduin

    dbi -> sqlrelay -> mssql performance

    Raphael Bauduin, Jun 27, 2003, in forum: Ruby
    Replies:
    1
    Views:
    181
    Stefan Schmiedl
    Jul 1, 2003
  3. Replies:
    0
    Views:
    167
  4. Replies:
    1
    Views:
    194
  5. doug
    Replies:
    1
    Views:
    140
    Julia De Silva
    Jun 7, 2005
Loading...

Share This Page