There can be some characters requiring multiple bytes .. e.g. French characters
Oracle default character data type uses byte semantic i.e. VARCHAR2(30) is same as VARCHAR2(30 BYTE)
One can also define the data type as VARCHAR2(30 CHAR) meaning it will include 30 characters even if multiple bytes
So question arises when we use VARCHAR2(30) , how Oracle knows its byte or Char?
Well the reason is in instance parameters
select * from v$parameter where name like 'nls_length_semantics'
Value BYTE indicates the length is in bytes
Toad describe table command caused the question to be raised why Bytes? :)
Oracle default character data type uses byte semantic i.e. VARCHAR2(30) is same as VARCHAR2(30 BYTE)
One can also define the data type as VARCHAR2(30 CHAR) meaning it will include 30 characters even if multiple bytes
So question arises when we use VARCHAR2(30) , how Oracle knows its byte or Char?
Well the reason is in instance parameters
select * from v$parameter where name like 'nls_length_semantics'
Value BYTE indicates the length is in bytes
Toad describe table command caused the question to be raised why Bytes? :)
No comments:
Post a Comment