Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Gary Chen <f2ind at yahoo dot com>
Subject: Re: How To Send String in UTF-8 Format to Sybase
Date: Mar 9 2001 9:52PM

Do you mean to change to:
	{CON_PROPS => {
	CS_HOSTNAME => 'test.db',
	CS_SYB_CHARSET => 'utf8' }};

But this didn't work either.  

The STP parameter is defined varbinary(40); when I
sent the parameter string in ASCII/UTF-8 encodeing, it
worked.  But when I sent the parameter string which
contains accented character (e.g. "") then it doesn't
work.   The stp in Sybase does the following:

select @foundArea=NULL
select @foundArea=id from area where id=@id
if @foundArea is NULL
return 1

I always get the retcode = 1.

Do I need to do something special on the Sybase side? 

Thanks again for your help.


--- Michael Peppler  wrote:
> Gary Chen writes:
>  > I wrote a test program which reads in text string
> and
>  > translates it into UTF8 format and sends to
> Sybase,
>  > which stores the data in UTF8 format.
>  > 
>  > I have open a db connection without error by
> using the
>  > following:
>  > 
>  >     $dbh = new Sybase::CTlib $uid, $pw, $svr,
> 't_utf',
>  >       {CON_PROPS => { 
>  >       CS_HOSTNAME() => 'test.db',
>  >       CS_SYB_CHARSET() => 'utf8' }};
> I think this is the problem. You are using
> CS_SYB_CHARSET(), but the
> code expects CS_SYB_CHARSET (i.e. the string, not
> the numeric
> value). Same with CS_HOSTNAME().
> Michael
> -- 
> Michael Peppler - Data Migrations Inc. -
> -
> International Sybase User Group -
> Sybase on Linux mailing list:

Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.