Multiple choice technology databases

Select length(-1) from dual What is the output of the above sql stmt

  1. 2

  2. 1

  3. 0

  4. error

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The LENGTH function in Oracle returns the character count of its argument after converting it to a string. When passed -1, Oracle implicitly converts it to the string '-1', which contains 2 characters: the minus sign and the digit 1. The LENGTH function counts all characters including signs and decimal points. This is not an error - Oracle allows implicit type conversion from number to varchar2.