Description:
CONCAT function allows you to concatenate only two strings together.
syntax:
Concat(char1,char2);
Concat returns char1 concatenated with char2.
Both char1 and char2 can be any of the datatypes
CHAR
,VARCHAR2
, NCHAR
, NVARCHAR2
, CLOB
, or NCLOB
.
The string returned is in the same character set as char1.
Its datatype depends on the datatypes of the arguments.
In concatenations of two different datatypes, Oracle Database returns the datatype that results in a lossless conversion.
Therefore, if one of the arguments is a LOB, then the returned value is a LOB. If one of the arguments is a national datatype, then the returned value is a national datatype.
For example:
·
CONCAT
(CLOB
, NCLOB
)
returns NCLOB
·
CONCAT
(NCLOB
, NCHAR
)
returns NCLOB
·
CONCAT
(NCLOB
, CHAR
)
returns NCLOB
·
CONCAT
(NCHAR
, CLOB
)
returns NCLOB
This function is equivalent to the concatenation operator (||).
examples:
select concat('Connect ','gad')
from dual;
select concat(concat('Connect ','gad'),' blog')
from dual;
No comments :
Post a Comment