Shahid Ghafoor
Shahid Ghafoor

Reputation: 3103

CHAR_LENGTH IS BYTE OR CHAR

I am using

SELECT 
COLUMN_NAME, DATA_TYPE, DATA_LENGTH, DATA_DEFAULT,CHAR_LENGTH
FROM ALL_TAB_COLUMNS WHERE TABLE_NAME LIKE '%SER_TBLSERVICES%'

CHAR_LENGTH shows only length, obviously :)

With reference to Oracle, if data type is varchar2 then we have to give size and whether provided value is in bytes or chars.

How we can get information in above query - whether CHAR_LENGTH is in bytes or in chars?

Upvotes: 2

Views: 2352

Answers (1)

andr
andr

Reputation: 16054

I hope I understand your question correctly.

Check the value of CHAR_USED column:

  • 'B' means byte length semantics
  • 'C' means character length semantics

You can consult the documentation on ALL_TAB_COLUMNS for Oracle 10.2 here.

Upvotes: 4

Related Questions