The following are examples of Oracle SQL queries to get the column length.
Get Column Length using the length() and dbms_lob.getlength() Functions in Oracle
Below is the SQL query which uses the length()
function to get the length of a column in Oracle:
Select first_name, length(first_name) len from emp;
The output would be several rows containing columns first_name and its length information.
To get the length of any string, use the following query:
Select length('hello world!') len from dual;
To get the length of the LOB column in Oracle, use dbms_lob.getlength()
function. Below is the example:
Select first_name, dbms_lob.getlength(emp_resume) len from emp;
Leave a comment
You must login or register to add a new comment.