www.oradev.com
  Database   Sql   Functions   Packages   Performance   Books   Oracle   Other   About   XML   ORA-messages
  Oracle concat string

Database/Sql

Oracle Regular Expressions
Timestamp
SQL Date format
String concatenation
Loop in pl/sql
SQL IN-clause
Regular Expressions Examples
Flashback query
Grant/revoke privileges
Sequence
Rename tables, columns
Insert into Oracle
Database name
Table with sequenced numbers
Oracle connect by
Add columns to table


  OraDev.com

Oracle String concatenation

The || operator does a String concatenation in Oracle.
You can use this in both SQL and pl/sql.
For example:
select kol1||kol2
from  tablename;

select kol1||' - '||kol2
from  tablename;

declare 
  l_var varchar2(2000);
begin
  l_var := 'abc'||'def';
end;
This is the short notation. You can also call the function 'concat'.
The concat function is limited to 2 parameters. With || you can concatenate a lot of strings together.

SELECT CONCAT(kol1,kol2)
from tablename;

declare 
  l_var varchar2(2000);
begin
  l_var := concat('abc','def');
end;