Skip to content
Related Articles

Related Articles

Improve Article
PLSQL | CONCAT Function
  • Last Updated : 18 Sep, 2019

The string in PL/SQL is actually a sequence of characters with an optional size specification.
The characters could be numeric, letters, blank, special characters or a combination of all.
The CONCAT function allows you to concatenate two strings together. To CONCAT more than two values, we can nest multiple CONCAT function calls.

Syntax:

CONCAT( string1, string2 )

Parameters Used:

  1. string1: It is used to specify the first string to concatenate.
  2. string2: It is used to specify the second string to concatenate.

Supported Versions of Oracle/PLSQL:

  1. Oracle 12c
  2. Oracle 11g
  3. Oracle 10g
  4. Oracle 9i
  5. Oracle 8i

Example-1:



DECLARE 
   Test_String string(10) := 'Hello ';
   Test_String2 string(10) := 'world!';
   
BEGIN 
   dbms_output.put_line(CONCAT(Test_String, Test_String2)); 
   
END; 

Output:

Hello world! 

Example-2:

DECLARE 
   Test_String string(10) := 'Geeks';
   Test_String2 string(10) := 'For';
   Test_String3 string(10) := 'Geeks';
   
BEGIN 
   dbms_output.put_line(CONCAT(CONCAT(Test_String, Test_String2), Test_String3)); 
   
END; 

Output:

GeeksForGeeks 
My Personal Notes arrow_drop_up
Recommended Articles
Page :