Dusan Kolesar wrote:

> 
> Hello,
> 
> I have a problem with Varchar BYTE concatenation.
> 
> CREATE TABLE "ADMIN"."TEST"
> (
>    "VC" Varchar (50) BYTE
> )
> //
> CREATE DBPROC TESTVC AS
>    VAR
>      msg        Varchar(100) BYTE;
>      byteDistLo Varchar(1) BYTE;
>      byteDistHi Varchar(1) BYTE;
> BEGIN
>    SET byteDistLo  = x'00';
>    SET byteDistHi  = x'00';
> 
>    SET msg = x'91' || x'00' || byteDistLo  || byteDistHi  || x'ff';
>    INSERT ADMIN.TEST (VC) VALUES (:msg);
> END;
> //
> CALL TESTVC
> 
> I expect '91000000ff' in the TEST table, but I get '9100ff'
> Is it bug, or am I doing something wrong ??
> 
> Regards, Dusan
> 

the answer looks a little bit -- strange --, but will help:

SET msg = x'91' || x'00' || substr(byteDistLo,1,1)  || substr(byteDistHi,1,1)  || 
x'ff';

Elke
SAP Labs Berlin

> -- 
> MaxDB Discussion Mailing List
> For list archives: http://lists.mysql.com/maxdb
> To unsubscribe:    
> http://lists.mysql.com/[EMAIL PROTECTED]
> 

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to