Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Can not use chinese charaters as query condition with Sybase and BDE?

8 posts in General Discussion Last posting was on 2003-01-24 13:22:29.0Z
Bao Yadong Posted on 2003-01-22 02:34:09.0Z
Reply-To: "Bao Yadong" <baoyd@creasoft.com.sg>
From: "Bao Yadong" <baoyd@creasoft.com.sg>
Subject: Can not use chinese charaters as query condition with Sybase and BDE?
Date: Wed, 22 Jan 2003 10:34:09 +0800
Lines: 41
Organization: Creative Software
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <TtryTGcwCHA.351@forums.sybase.com>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: 203.125.230.50
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub ianywhere.public.general:273
Article PK: 2090

Hi,
I am using C++ builder 5.0 to developing application. The database is
Sybase Server Anywhere 6.0.
I encount problem when I am using chinese charaters.
I connect Database through ODBC.
I have tested the following statement in SQL Explore or query component in
C++ builder
select * from personal where SexID='ÄÐ' //get all male employee
It will return nothing.
But if I test the same statement in DBISQL which is a tools provided by
Sybase
It will return me all male employee correctly.

Actually I realise something
if we test following statement in SQL Explore in C++ builder
1. select length('ÄÐ')
It will return 1, but actually it should return 2 because 'ÄÐ' is a
chinese charater.
2. select length(SexID) from personal
It will return 2.
I guss that is why "select * from personal where SexID='ÄÐ'" return me
nothing

But if I test "select length('ÄÐ')" and "select length(SexID) from
personal" in
DBISQL. They all return me 2.

I think the only difference between SQL Explore and DBISQL is BDE. DBISQL
directly uses sybase ODBC driver and SQL Explore needs go through BDE.

Anyone has solution for that?


Thanks very much

Bao Yadong
baoyd@creasoft.com.sg


Raymond_Kwong Posted on 2003-01-22 19:11:29.0Z
From: Raymond_Kwong
Date: Wed, 22 Jan 2003 14:11:29 -0500
Newsgroups: ianywhere.public.general
Subject: Re: Can not use chinese charaters as query condition with Sybase and BDE?
Message-ID: <4A0D308F14639CB500696C1885256CB6.001354D685256CB6@webforums>
References: <TtryTGcwCHA.351@forums.sybase.com>
Lines: 15
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:266
Article PK: 2084

Would this work for you then?

select * from personal where cast(SexID as long binary)=<value>



If the database uses 936ZHO collation, <value> is
'\xC4\xD0'


If the database uses UTF8 collation, <value> is
'\xE7\x94\xB7'

Raymond Kwong
iAnywhere Solutions


Bao Yadong Posted on 2003-01-23 01:58:40.0Z
Reply-To: "Bao Yadong" <baoyd@creasoft.com.sg>
From: "Bao Yadong" <baoyd@creasoft.com.sg>
References: <TtryTGcwCHA.351@forums.sybase.com> <4A0D308F14639CB500696C1885256CB6.001354D685256CB6@webforums>
Subject: Re: Can not use chinese charaters as query condition with Sybase and BDE?
Date: Thu, 23 Jan 2003 09:58:40 +0800
Lines: 41
Organization: Creative Software
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <s#7RLXowCHA.351@forums.sybase.com>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: 203.125.230.50
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub ianywhere.public.general:264
Article PK: 2081

Thanks for your reply.
It returns records if I use "select * from personal where cast(SexID as
long binary)='ÄÐ'", but I can not display SexID correctly any more because
the return value for SexID becomes 1 byte instead 2 bytes. So I can not use
this method.
Actually we can get the correct value from database because everything
will display correctly when I use "select * from personal". Now I guess the
problem is that Sybase+BDE always case 'ÄÐ' to long binary automatically.
I aslo notice following problem. I can update chinese charaters into
database correctly if I use the data-aware components and Post method in C++
Builder. I also can do it correctly with SQL statement "update personal set
PersonalName= 'À' where PersonalSysId=10" in DBISQL. But it will be wrong
if I use the same SQL statement "update personal set PersonalName= 'À'
where PersonalSysId=10" in SQL Explore or query component, 'À'will be
auto-cased to long binary and it will become 2 bytes instead 4 bytes.
Now I feel the problem is how we can prevent Sybase+BDE to auto-case
chinese charaters to long binary.
Do you have any idea about it?

<Raymond_Kwong> wrote in message
news:4A0D308F14639CB500696C1885256CB6.001354D685256CB6@webforums...
> Would this work for you then?
>
> select * from personal where cast(SexID as long binary)=<value>
>
>
>
> If the database uses 936ZHO collation, <value> is
> '\xC4\xD0'
>
>
> If the database uses UTF8 collation, <value> is
> '\xE7\x94\xB7'
>
> Raymond Kwong
> iAnywhere Solutions


Robert Waywell Posted on 2003-01-23 14:18:53.0Z
From: "Robert Waywell" <rwaywell@ianywhere.com>
References: <TtryTGcwCHA.351@forums.sybase.com> <4A0D308F14639CB500696C1885256CB6.001354D685256CB6@webforums> <s#7RLXowCHA.351@forums.sybase.com>
Subject: Re: Can not use chinese charaters as query condition with Sybase and BDE?
Date: Thu, 23 Jan 2003 09:18:53 -0500
Lines: 78
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <OniE2zuwCHA.199@forums.sybase.com>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: 172.31.143.74
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub ianywhere.public.general:262
Article PK: 2080

Hi Bao,
Probably the best approach is to open a case with Tech Support and
submit the reproducible. At this point it is difficult to say where the
problem is, whether in the ASA ODBC driver, or somewhere in the BDE, or a
translation point that isn't configured properly. As you have seen with
DBISQL, ASA is quite capable of handling the multi-byte characters.

--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://casexpress.sybase.com/cx/cx.stm

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer

"Bao Yadong" <baoyd@creasoft.com.sg> wrote in message
news:s#7RLXowCHA.351@forums.sybase.com...
> Thanks for your reply.
> It returns records if I use "select * from personal where cast(SexID as
> long binary)='ÄÐ'", but I can not display SexID correctly any more because
> the return value for SexID becomes 1 byte instead 2 bytes. So I can not
use
> this method.
> Actually we can get the correct value from database because everything
> will display correctly when I use "select * from personal". Now I guess
the
> problem is that Sybase+BDE always case 'ÄÐ' to long binary automatically.
> I aslo notice following problem. I can update chinese charaters into
> database correctly if I use the data-aware components and Post method in
C++
> Builder. I also can do it correctly with SQL statement "update personal
set
> PersonalName= 'À' where PersonalSysId=10" in DBISQL. But it will be
wrong
> if I use the same SQL statement "update personal set PersonalName= 'À'
> where PersonalSysId=10" in SQL Explore or query component, 'À'will be
> auto-cased to long binary and it will become 2 bytes instead 4 bytes.
> Now I feel the problem is how we can prevent Sybase+BDE to auto-case
> chinese charaters to long binary.
> Do you have any idea about it?
>
>
>
>
> <Raymond_Kwong> wrote in message
> news:4A0D308F14639CB500696C1885256CB6.001354D685256CB6@webforums...
> > Would this work for you then?
> >
> > select * from personal where cast(SexID as long binary)=<value>
> >
> >
> >
> > If the database uses 936ZHO collation, <value> is
> > '\xC4\xD0'
> >
> >
> > If the database uses UTF8 collation, <value> is
> > '\xE7\x94\xB7'
> >
> > Raymond Kwong
> > iAnywhere Solutions
>
>


Raymond_Kwong Posted on 2003-01-23 15:11:09.0Z
From: Raymond_Kwong
Date: Thu, 23 Jan 2003 10:11:09 -0500
Newsgroups: ianywhere.public.general
Subject: Re: Can not use chinese charaters as query condition with Sybase and BDE?
Message-ID: <AAEEC5FCD14DD92E00536B1485256CB7.0052DF7185256CB7@webforums>
References: <TtryTGcwCHA.351@forums.sybase.com> <4A0D308F14639CB500696C1885256CB6.001354D685256CB6@webforums> <s#7RLXowCHA.351@forums.sybase.com> <OniE2zuwCHA.199@forums.sybase.com>
Lines: 11
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:261
Article PK: 2082

To add to it the following would be of use:

Use the dbsrv?.exe with the -zr all switch that Rob mentioned before -- the
output would tell you what instructions were passed to the database server

ODBC trace

And also, if you've got a chance to test with other RDBMS products (not
that I encourage you to use them in production at all!), testing the same
steps against those databases would be very useful to determine if it is an
ASA or a BDE problem.


Bao Yadong Posted on 2003-01-24 05:00:36.0Z
Reply-To: "Bao Yadong" <baoyd@creasoft.com.sg>
From: "Bao Yadong" <baoyd@creasoft.com.sg>
References: <TtryTGcwCHA.351@forums.sybase.com> <4A0D308F14639CB500696C1885256CB6.001354D685256CB6@webforums> <s#7RLXowCHA.351@forums.sybase.com> <OniE2zuwCHA.199@forums.sybase.com> <AAEEC5FCD14DD92E00536B1485256CB7.0052DF7185256CB7@webforums>
Subject: Re: Can not use chinese charaters as query condition with Sybase and BDE?
Date: Fri, 24 Jan 2003 13:00:36 +0800
Lines: 31
Organization: Creative Software
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <78Y8hh2wCHA.351@forums.sybase.com>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: 203.125.230.50
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub ianywhere.public.general:249
Article PK: 2068

I have tested with MSSQL and Interbase. They do not have such problem.
Every RDBMS product needs provide the BDE driver for BDE.
Followings are the drivers for different RDBMS.
SYBASE:SQLSYB32.DLL or SQLSSC32.DLL (I have tried both)
Interbase: SQLINT32.DLL
MSSQL: SQLMSS32.DLL

I think the SYBASE DBE driver causes the problem because it is no problem
DBISQL and BDE can work with other RDBMS.

Do you know whether Sybase has any new or latest BDE drivers?

<Raymond_Kwong> wrote in message
news:AAEEC5FCD14DD92E00536B1485256CB7.0052DF7185256CB7@webforums...
> To add to it the following would be of use:
>
> Use the dbsrv?.exe with the -zr all switch that Rob mentioned before --
the
> output would tell you what instructions were passed to the database server
>
> ODBC trace
>
> And also, if you've got a chance to test with other RDBMS products (not
> that I encourage you to use them in production at all!), testing the same
> steps against those databases would be very useful to determine if it is
an
> ASA or a BDE problem.


Robert Waywell Posted on 2003-01-24 13:22:29.0Z
From: "Robert Waywell" <rwaywell@ianywhere.com>
References: <TtryTGcwCHA.351@forums.sybase.com> <4A0D308F14639CB500696C1885256CB6.001354D685256CB6@webforums> <s#7RLXowCHA.351@forums.sybase.com> <OniE2zuwCHA.199@forums.sybase.com> <AAEEC5FCD14DD92E00536B1485256CB7.0052DF7185256CB7@webforums> <78Y8hh2wCHA.351@forums.sybase.com>
Subject: Re: Can not use chinese charaters as query condition with Sybase and BDE?
Date: Fri, 24 Jan 2003 08:22:29 -0500
Lines: 65
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <g6OWA56wCHA.344@forums.sybase.com>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: 172.31.143.74
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub ianywhere.public.general:244
Article PK: 2064

There is no 'native' BDE driver for ASA. The one you are looking at is (I
believe) for ASE. You should be connecting to ASA using either ODBC or
OLEDB. As an alternative, you can check out one of the third party Borland
interfaces that gets mentioned regularly in the newsgroup
sybase.public.sqlanywhere.general. NativeDB would be one example.

--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://casexpress.sybase.com/cx/cx.stm

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer

"Bao Yadong" <baoyd@creasoft.com.sg> wrote in message
news:78Y8hh2wCHA.351@forums.sybase.com...
> I have tested with MSSQL and Interbase. They do not have such problem.
> Every RDBMS product needs provide the BDE driver for BDE.
> Followings are the drivers for different RDBMS.
> SYBASE:SQLSYB32.DLL or SQLSSC32.DLL (I have tried both)
> Interbase: SQLINT32.DLL
> MSSQL: SQLMSS32.DLL
>
> I think the SYBASE DBE driver causes the problem because it is no
problem
> DBISQL and BDE can work with other RDBMS.
>
> Do you know whether Sybase has any new or latest BDE drivers?
>
>
>
> <Raymond_Kwong> wrote in message
> news:AAEEC5FCD14DD92E00536B1485256CB7.0052DF7185256CB7@webforums...
> > To add to it the following would be of use:
> >
> > Use the dbsrv?.exe with the -zr all switch that Rob mentioned before --
> the
> > output would tell you what instructions were passed to the database
server
> >
> > ODBC trace
> >
> > And also, if you've got a chance to test with other RDBMS products (not
> > that I encourage you to use them in production at all!), testing the
same
> > steps against those databases would be very useful to determine if it is
> an
> > ASA or a BDE problem.
>
>


Robert Waywell Posted on 2003-01-22 16:16:12.0Z
From: "Robert Waywell" <rwaywell@ianywhere.com>
References: <TtryTGcwCHA.351@forums.sybase.com>
Subject: Re: Can not use chinese charaters as query condition with Sybase and BDE?
Date: Wed, 22 Jan 2003 11:16:12 -0500
Lines: 71
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <EZWCuQjwCHA.254@forums.sybase.com>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: 172.31.143.74
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub ianywhere.public.general:272
Article PK: 2092

As a starting point, take a look at the -zr all output on the engine to see
what is being received by the engine.

--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://casexpress.sybase.com/cx/cx.stm

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer

"Bao Yadong" <baoyd@creasoft.com.sg> wrote in message
news:TtryTGcwCHA.351@forums.sybase.com...
> Hi,
> I am using C++ builder 5.0 to developing application. The database is
> Sybase Server Anywhere 6.0.
> I encount problem when I am using chinese charaters.
> I connect Database through ODBC.
> I have tested the following statement in SQL Explore or query component
in
> C++ builder
> select * from personal where SexID='ÄÐ' //get all male employee
> It will return nothing.
> But if I test the same statement in DBISQL which is a tools provided by
> Sybase
> It will return me all male employee correctly.
>
> Actually I realise something
> if we test following statement in SQL Explore in C++ builder
> 1. select length('ÄÐ')
> It will return 1, but actually it should return 2 because 'ÄÐ' is a
> chinese charater.
> 2. select length(SexID) from personal
> It will return 2.
> I guss that is why "select * from personal where SexID='ÄÐ'" return
me
> nothing
>
> But if I test "select length('ÄÐ')" and "select length(SexID) from
> personal" in
> DBISQL. They all return me 2.
>
> I think the only difference between SQL Explore and DBISQL is BDE. DBISQL
> directly uses sybase ODBC driver and SQL Explore needs go through BDE.
>
> Anyone has solution for that?
>
>
> Thanks very much
>
> Bao Yadong
> baoyd@creasoft.com.sg
>
>
>
>