Saturday, September 25, 2010

Length Semantics in DB Profile


If we describe any table in OBIEE environment, we can find that all the string column sizes are 4 times the actual size.

For e.g.; In table W_SUPPLIER_ACCOUNT_D
PAY_TERMS_CODE        VARCHAR (200)
PAY_TERMS_NAME        VARCHAR (320)

If we refer the same columns in Informatica and Oracle BI Repository, the column sizes would be  VARCHAR (50) and VARCHAR (80) respectively.

The reason behind this anomaly is that DB profile is set with Length Semantics to BYTE instead of CHAR.
i.e.; PAY_TERMS_CODE        VARCHAR (200) = VARCHAR (200 BYTE) = VARCHAR (50 CHAR)

So going forward whenever you extend any base table for adding a string column, specify the syntax as CHAR explicitly.

i.e.;  alter table W_SUPPLIER_ACCOUNT_D
    add X_VAT_CODE VARCHAR2(50 CHAR);