1.

How to use LIKE operator in PL/SQL?

Answer»

The FOLLOWING are the methods AVAILABLE in PL/SQL to TRIM characters:

MethodDescription
LTRIM(x [, trim_string]);Trims characters from the left of x.
RTRIM(x [, trim_string]);Trims characters from the RIGHT of x.
TRIM([trim_char FROM) x);Trims characters from the left and right of x.

The following is how you can use LTRIM() in PL/SQL to trim characters from the left:

DECLARE   cars VARCHAR2(30) := '......Bentley.....'; BEGIN  dbms_output.put_line(LTRIM(cars,'.')); END; /

The output:

Bentley.....

The following is how you can use RTRIM() in PL/SQL to trim characters from the right:

DECLARE   cars varchar2(30) := '......Bentley.....'; BEGIN  dbms_output.put_line(RTRIM(cars,'.')); END; /

The output:

......Bentley

The following is how you can use TRIM() in PL/SQL to trim characters from the right and left:

DECLARE   cars varchar2(30) := '......Bentley.....'; BEGIN  dbms_output.put_line(TRIM(cars,'.')); END; /

The output:

Bentley


Discussion

No Comment Found