René Nyffenegger's collection of things on the web | |
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
|
length [Oracle SQL] | ||
length(string) lengthb(string) lengthc(string) length2(string) length4(string) length returns the length of the string passed.
If string is a number, it first converts the number into a string and then returns its length.
As Oracle treats an empty string as null, the length of an empty string is
also null.
select length('hello world'), length(42), length(9.0), length(10.1), length(-8), length('') from dual; LENGTH('HELLOWORLD') LENGTH(42) LENGTH(9.0) LENGTH(10.1) LENGTH(-8) LENGTH('') -------------------- ---------- ----------- ------------ ---------- ---------- 11 2 1 4 2 |