FAQ
when I simply use perl DBI, DBD::ODBC to connect to the database and try to extract the Unicode string(
there is Chinese, Japanese, Korea) string stored in it, the return value is unreadable. I wish to get UTF-8 string so that those
double byte language can be readable.

so, what configuration I need to do to the DBI, ODBC ?

thanks

hugh wang

CM Engineer
MicroStrategy Inc.

Search Discussions

  • Jeff Urlwin at Dec 9, 2004 at 9:19 pm
    DBD::ODBC has not even been tested with UTF-8 data.

    Patches/tests most welcome!!!!!!

    Regards,

    Jeff


    -----Original Message-----
    From: Yonghui Wang
    Sent: Thursday, December 09, 2004 4:09 PM
    To: dbi-users@perl.org
    Subject: how can I extract String as UTF-8 under UNIX, my
    data was in SQL Server Database and stored as Unicode data


    when I simply use perl DBI, DBD::ODBC to connect to the
    database and try to extract the Unicode string(
    there is Chinese, Japanese, Korea) string stored in it, the
    return value is unreadable. I wish to get UTF-8 string so that those
    double byte language can be readable.

    so, what configuration I need to do to the DBI, ODBC ?

    thanks

    hugh wang

    CM Engineer
    MicroStrategy Inc.
  • David Goodman at Dec 9, 2004 at 10:04 pm
    I checked that DBD::Sybase documentation and did not
    find a way to get the number of rows affected by the
    previous statement.

    Is there an equivalent for ct_res_info()? Or is select
    @@rowcount the only way to do it?

    regards,

    David
  • Matthew Persico at Dec 10, 2004 at 12:56 am
    Check the DBI docs - I seem to remember a generic function to call
    for all DBDs which should be implemented to work for particular DBDs


    On Thu, 9 Dec 2004 14:03:57 -0800 (PST), David Goodman
    wrote:
    I checked that DBD::Sybase documentation and did not
    find a way to get the number of rows affected by the
    previous statement.

    Is there an equivalent for ct_res_info()? Or is select
    @@rowcount the only way to do it?

    regards,

    David

    --
    Matthew O. Persico
  • Chuck Fox at Dec 10, 2004 at 1:45 am
    But for DBD::Sybase and most others it only tells you after you have fetched/processed the whole result set.


    Matthew Persico wrote on 12/9/2004, 7:56 PM:
    Check the DBI docs - I seem to remember a generic function to call
    for all DBDs which should be implemented to work for particular DBDs


    On Thu, 9 Dec 2004 14:03:57 -0800 (PST), David Goodman
    wrote:
    I checked that DBD::Sybase documentation and did not
    find a way to get the number of rows affected by the
    previous statement.

    Is there an equivalent for ct_res_info()? Or is select
    @@rowcount the only way to do it?

    regards,

    David

    --
    Matthew O. Persico
    --
    Your Friendly Neighborhood DBA,

    Chuck
  • Matthew Persico at Dec 10, 2004 at 1:57 am
    True. You might as well just count along as you fetch. If you do() an
    insert/update or delete, the return value from the do is the number of
    rows (OEO on none, undef on error?)

    On Thu, 9 Dec 2004 20:45:20 -0500, Chuck Fox wrote:
    But for DBD::Sybase and most others it only tells you after you have fetched/processed the whole result set.

    Matthew Persico wrote on 12/9/2004, 7:56 PM:

    Check the DBI docs - I seem to remember a generic function to call
    for all DBDs which should be implemented to work for particular DBDs


    On Thu, 9 Dec 2004 14:03:57 -0800 (PST), David Goodman
    wrote:
    I checked that DBD::Sybase documentation and did not
    find a way to get the number of rows affected by the
    previous statement.

    Is there an equivalent for ct_res_info()? Or is select
    @@rowcount the only way to do it?

    regards,

    David

    --
    Matthew O. Persico
    --
    Your Friendly Neighborhood DBA,

    Chuck

    --
    Matthew O. Persico
  • Michael Peppler at Dec 10, 2004 at 6:43 am

    On Thu, 2004-12-09 at 23:03, David Goodman wrote:
    I checked that DBD::Sybase documentation and did not
    find a way to get the number of rows affected by the
    previous statement.

    Is there an equivalent for ct_res_info()? Or is select
    @@rowcount the only way to do it?
    ct_res_info() (in C) will only return the number of rows returned by a
    SELECT after all the rows have been fetched.

    Same with SELECT @@rowcount (for obvious reasons - it's a bit hard to
    run SELECT @@rowcount *before* the SELECT data... :-)

    So DBD::Sybase's $sth->rows implementation will return valid data for
    SELECT statements right after the last row has been fetched.

    $sth->rows will return correct data immediately after execute() for
    INSERT/UPDATE/DELETE statements.

    Michael
    --
    Michael Peppler - mpeppler@peppler.org - http://www.peppler.org/
    Sybase DBA/Developer
    Available for contract work - http://www.peppler.org/resume.html

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdbi-users @
categoriesperl
postedDec 9, '04 at 9:09p
activeDec 10, '04 at 6:43a
posts7
users6
websitedbi.perl.org

People

Translate

site design / logo © 2022 Grokbase