VARBYTE

Database
Enthusiast

VARBYTE

Hi,

 

the variable "Identifier" has defined as VARBYTE(50)

 

I want to make the comparison:

 

Identifier <> 0||'x'||0000000000000000000000000000000000000000000000000000000000000000

 

and i'm getting an error:

Executed as Single statement. Failed [3640 : 22018] Comparing BYTE data in column Identifier with other types is illegal.
Elapsed time = 00:00:00.089

STATEMENT 1: Create Table failed.

 

Any idea why I'm getting this error?

 

Thanks in advance

4 REPLIES
Senior Supporter

Re: VARBYTE

try '0000000000000000000000000000000000000000000000000000000000000000'xb

Junior Contributor

Re: VARBYTE

In Teradata the syntax for byte literals is: '12ff'xb

Junior Contributor

Re: VARBYTE

In Teradata the syntax for byte literals is: '12ff'xb

 

Btw, there's no need for all those zeroes, when two BYTEs are compared the shorter is padded with zeroes to the length of the longer one:

'00'xb = '00000000'xb

Enthusiast

Re: VARBYTE

Thanks a lot!