Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Byte_substr string function behaviour

6 views
Skip to first unread message

Aparna Kurada

unread,
Oct 1, 2009, 5:12:06 PM10/1/09
to
There is difference in behaviour between SA variable and column for
byte_substr string function.

Byte_substr for SA variable returns a binary value:
create variable testv_longvarchar long varchar
set testv_longvarchar='a'
select byte_substr( testv_longvarchar,1,1)=>returns binary

Byte_substr for SA column returns a character value:
create table testiqtab_longvarchar (c_longvarchar long varchar) in
system
insert into testiqtab_longvarchar values('a')
select byte_substr(c_longvarchar,1,1) from
testiqtab_longvarchar=>returns character

Is it an expected behaviour?

Thank you,
Aparna

John Smirnios [Sybase]

unread,
Oct 1, 2009, 9:39:59 PM10/1/09
to
The byte_substr(testv_longvarchar) comes back as long varchar for me
using SA9 and varchar(1) using SA11. It looks like you are using IQ and
possibly that is making a difference? I would have thought everything in
the queries you posted would be handled on the SA side but I'm not
certain. BTW, to determine the data type of the expression I used

select exprtype('select byte_substr( testv_longvarchar,1,1)',1)

-john.
--
John Smirnios
Senior Software Developer
iAnywhere Solutions Engineering

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

0 new messages