1.

How to perform concatenation in PL/SQL?

Answer»

To join two or more strings i.e. concatenation, PL/SQL COMES with concatenation operator (||). This operator returns a string value.

The following is the syntax:

str1 || str2 [ || str_n ]

Here,

  • str1 = String 1
  • str2 = String 2
  • str_n = nth string

The following is an example:

DECLARE   ONE VARCHAR2(20) := 'Website';   two varchar2(20) := ' World!'; BEGIN   dbms_output.put_line(one || two); END; /

The output:

Website World!


Discussion

No Comment Found