FAQ
I'm using perl 5.8.8 with DBD::Sybase 1.09, and the SQL statement
below appears to prepare and execute fine, but I've also just compiled
a perl 5.14.1 with DBD::Sybase 1.12, and with the newer versions I get
the following error on prepare:

DBD::Sybase::db prepare failed: Server message number=2401 severity=11
state=2 line=0 server=TESTASE text=Character set conversion is not
available between client character set 'utf8' and server character set
'iso_1'.
Server message number=2411 severity=10 state=1 line=0 server=TESTASE
text=No conversions will be done.

If I add ';charset=iso_1' to the dsn string on connect, then
everything seems to work ok. I'm just wondering what changed the
behavior (perl? DBD::Sybase?), and if I've handled it correctly or
done something else wrong...

Thanks...

my $upd_sql = <<SQL;
UPDATE my_table
SET
group_nbr = ?, last_ch_user = user, last_ch_date = getdate()
WHERE primary_id = ?
AND source_id = 100
SQL

Search Discussions

  • Michael Peppler at Aug 9, 2011 at 1:40 pm
    There was a change in 1.11 (I think) to handle utf8/unicode data. THis
    included forcing the charset to utf8 in the client.

    You can go back to the old behavior if you edit dbdimp.c and change or
    comment out the following:

    if (retcode == CS_SUCCEED) {
    if ((retcode = cs_locale(context, CS_SET, locale, CS_SYB_CHARSET,
    "utf8", CS_NULLTERM, NULL)) != CS_SUCCEED) {
    warn("cs_locale(CS_SYB_CHARSET) failed");
    }
    }

    in the syb_init() call.

    I'll need to review that decision to see how to make it work for both
    unicode and non-unicode data.

    Michael




    On Tue, Aug 9, 2011 at 2:58 AM, Douglas Wilson
    wrote:
    I'm using perl 5.8.8 with DBD::Sybase 1.09, and the SQL statement
    below appears to prepare and execute fine, but I've also just compiled
    a perl 5.14.1 with DBD::Sybase 1.12, and with the newer versions I get
    the following error on prepare:

    DBD::Sybase::db prepare failed: Server message number=2401 severity=11
    state=2 line=0 server=TESTASE text=Character set conversion is not
    available between client character set 'utf8' and server character set
    'iso_1'.
    Server message number=2411 severity=10 state=1 line=0 server=TESTASE
    text=No conversions will be done.

    If I add ';charset=iso_1' to the dsn string on connect, then
    everything seems to work ok. I'm just wondering what changed the
    behavior (perl? DBD::Sybase?), and if I've handled it correctly or
    done something else wrong...

    Thanks...

    my $upd_sql = <<SQL;
    UPDATE my_table
    SET
    group_nbr = ?, last_ch_user = user, last_ch_date = getdate()
    WHERE primary_id = ?
    AND source_id = 100
    SQL
  • Douglas Wilson at Aug 9, 2011 at 6:58 pm
    Just for an extra bit of FYI, the error only occurs when there's another statement prepared right before the update, so DBD::Sybase has to create another dbh because of the multiple active statement handles.



    -- Sent from my Palm Pre
    On Aug 9, 2011 6:40 AM, Michael Peppler &lt;mpeppler@peppler.org&gt; wrote:

    There was a change in 1.11 (I think) to handle utf8/unicode data. THis

    included forcing the charset to utf8 in the client.



    You can go back to the old behavior if you edit dbdimp.c and change or

    comment out the following:



    if (retcode == CS_SUCCEED) {

    if ((retcode = cs_locale(context, CS_SET, locale, CS_SYB_CHARSET,

    "utf8", CS_NULLTERM, NULL)) != CS_SUCCEED) {

    warn("cs_locale(CS_SYB_CHARSET) failed");

    }

    }



    in the syb_init() call.



    I'll need to review that decision to see how to make it work for both

    unicode and non-unicode data.



    Michael









    On Tue, Aug 9, 2011 at 2:58 AM, Douglas Wilson

    &lt;douglasg.wilson@gmail.com&gt; wrote:

    &gt; I'm using perl 5.8.8 with DBD::Sybase 1.09, and the SQL statement

    &gt; below appears to prepare and execute fine, but I've also just compiled

    &gt; a perl 5.14.1 with DBD::Sybase 1.12, and with the newer versions I get

    &gt; the following error on prepare:

    &gt;

    &gt; DBD::Sybase::db prepare failed: Server message number=2401 severity=11

    &gt; state=2 line=0 server=TESTASE text=Character set conversion is not

    &gt; available between client character set 'utf8' and server character set

    &gt; 'iso_1'.

    &gt; &nbsp;Server message number=2411 severity=10 state=1 line=0 server=TESTASE

    &gt; text=No conversions will be done.

    &gt;

    &gt; If I add ';charset=iso_1' to the dsn string on connect, then

    &gt; everything seems to work ok. I'm just wondering what changed the

    &gt; behavior (perl? DBD::Sybase?), and if I've handled it correctly or

    &gt; done something else wrong...

    &gt;

    &gt; Thanks...

    &gt;

    &gt; my $upd_sql = &lt;&lt;SQL;

    &gt; UPDATE my_table

    &gt; SET

    &gt; &nbsp;group_nbr = ?, last_ch_user = user, last_ch_date = getdate()

    &gt; WHERE primary_id = ?

    &gt; AND source_id = 100

    &gt; SQL

    &gt;

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdbi-users @
categoriesperl
postedAug 9, '11 at 12:58a
activeAug 9, '11 at 6:58p
posts3
users2
websitedbi.perl.org

2 users in discussion

Douglas Wilson: 2 posts Michael Peppler: 1 post

People

Translate

site design / logo © 2022 Grokbase