Tag: length

How to find length of a TEXT column?

The "LEN" function cannot be used to find length of a column of datatype "TEXT" so using function "DATALENGTH" one can find the length of TEXT field. Eg: SELECT DATALENGTH(textfiled) lentextfile FROM table;

How to find average row length for a table?

Using the following PL/SQL code one can find average size of a row in a table, the following code samples the first 100 rows. It expects 2 parameters table owner and table_name. DECLARE l_vc2_table_owner VARCHAR2(30) := '&table_owner'; l_vc2_table_name VARCHAR2(30) := '&table_name'; /* sample number of rows */ l_nu_sample_rows NUMBER := 100; /* loop through columns … Continue reading How to find average row length for a table?

How to find a length of LOB column?

Using dbms_lob.getlength(column name) one can find the length of the LOB (CLOB/BLOB/BFILE) data type. Example: SQL> SELECT dbms_lob.getlength(lob_column) FROM scott.lob_table; DBMS_LOB.GETLENGTH(lob_column) -------------------------------- 358 153 ...