Ajay wrote:
Hi ,
Is Bit & SBCS type same for column .
eg. create table test.tb01 (char (10)) SBCS for data
create table test.tb01 (char (10)) bit for data
Thanks
ARR
You mean char(10) for bit data and so on?
SBCS marks the char as in the SBCS encoding (1 byte = 1 character).
BIT marks char as being in no encoding at all. (a byte is a bye is a byte).
In the SQL Standard the appropriate binary would be BINARY instead of
CHAR. DB2 is haunted by pre-standard legacy here.
Now what's the difference in reality? When you e.g. insert data:
INSERT INTO TB01(c_bit, c_sbcs) VALUES (?, ?)
The first first parameter marker will be taken "as-is" from the client.
No conversion will be done. If the data is in say UTF-8 encoding the
binary representation of the data will be laid down on disk.
The data destined for c_sbcs however will be converted from UTF-8 to the
default encoding of the database (e.g. LATIN1).
The same happens when returning the data to the client.
Hope that helps
Serge