• Skip to primary navigation
  • Skip to main content

Tech Honey

The #1 Website for Oracle PL/SQL, OA Framework and HTML

  • Home
  • HTML
    • Tags in HTML
    • HTML Attributes
  • OA Framework
    • Item in OAF
    • Regions in OAF
    • General OAF Topics
  • Oracle
    • statement
    • function
    • clause
    • plsql
    • sql
You are here: Home / Oracle / function / Oracle PL/SQL LENGTH Function

Oracle PL/SQL LENGTH Function

November 24, 2012 by techhoneyadmin

Oracle PLSQL Length FunctionOracle PL/SQL LENGTH Function is used to return the length of a string. Oracle LENGTH Function calculates length by considering characters of input.


Oracle PL/SQL LENGTH Function Sytntax

SELECT LENGTH(string)
FROM table_name;

“string” is the string whose length is to be determined, if the length of the string is NULL then LENGTH Function returns NULL.


Oracle PL/SQL LENGTH Function – Use with SELECT Statement Example

The Oracle LENGTH Function is used with the SQL SELECT Statement.

For example the SQL SELECT Statement query with LENGTH Function returns the length of the string passed.

SELECT LENGTH('tech honey')
FROM dual;

Above mentioned SQL LENGTH Function will return ‘10’ as length of the string.


Oracle PL/SQL LENGTH Function – Use with NULL Example

SQL LENGTH Function can accept NULL as a parameter.

For example the SQL query below returns the length of NULL parameter.

SELECT LENGTH(NULL) "Oracle LENGTH Function"
FROM dual;

Above mentioned Oracle LENGTH Function will return ‘NULL’.


Oracle PL/SQL LENGTH Function – Zero Length String Example

Oracle LENGTH Function can also accept a string of 0 length.

For example the query below returns the length of a string with 0 length.

SELECT LENGTH('')
FROM dual;

Above mentioned PL/SQL LENGTH Function will return ‘NULL’.


Filed Under: function Tagged With: how to use LENGTH Function in oracle database query, how to use LENGTH Function in oracle plsql, how to use LENGTH Function in oracle sql, LENGTH Function in oracle plsql, LENGTH Function in oracle sql, LENGTHPLSQL, syntax and example of LENGTH Function in oracle database query, syntax and example of LENGTH Function in oracle plsql, syntax and example of LENGTH Function in oracle sql, using LENGTH Function in oracle database query, using LENGTH Function in oracle plsql, using LENGTH Function in oracle sql

Copyright © 2023 · Parallax Pro on Genesis Framework · WordPress · Log in