Convert to Lowercase in Oracle SQL

Convert to Lowercase in Oracle SQL

  • SQL
  • 1 min read

You can use the lower() function to convert a string to lowercase in Oracle SQL.

Lower() Syntax

lower(string)

Changing all letters of a string to lowercase Using SQL query

The following SQL query will convert the string to lowercase.

select lower('This is a STRING.') from Dual;

Output:

this is a string.

Using Lower() Function in WHERE Clause

select * from Emp where lower(ename) = 'king'

The above SQL query will return the records from the EMP table where the lower ENAME is equal to 'king'.

Lower() Function in PL/SQL Program

The following PL/SQL program assigns a string value by converting it to lowercase using the lower() function and prints on the screen:

declare
   v_string varchar2(100);
begin
   v_string := lower('This is a STRING.');
   dbms_output.put_Line(v_string);
end;

Output

this is a string.

See also: