0

In a DB2 database on Windows, I have a table with a column of data type 'varchar for bit data'. I insert a record in this table, and set a value for this column. When I select the record after that, I see a different value for this column then the value I set in the insert statement. It is obviously being converted implicitly. The value I want to see in this column when I select this record is '38E2C310275B6A8F7E966E9B529741BC'. Which value do I use in my insert statement to achieve this?

Thanks for helping me out.

1 Answer 1

1
create table fbd ( a varchar(32) for bit data)

insert into fbd(a) values X'38E2C310275B6A8F7E966E9B529741BC'

select a from fbd

A                                                                  
-------------------------------------------------------------------
x'38E2C310275B6A8F7E966E9B529741BC'                                



select hex(a) from fbd

1                                                               
----------------------------------------------------------------
38E2C310275B6A8F7E966E9B529741BC                                
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks mao. That is exaclty what I was looking for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.