SELECT owner,
table_name,
column_name,
data_type,
data_length,
SUM (
CASE data_type
WHEN 'DATE' THEN 7
WHEN 'NUMBER' THEN 22
ELSE data_length
END)
LENGTH
FROM all_tab_cols
WHERE table_name = UPPER ('T_MSG_ALARMINFO')
AND owner = UPPER ('lbs')
GROUP BY ROLLUP ( (owner, table_name, column_name, data_type, data_length))