Oracle9i SQL Reference
Release 1 (9.0.1)

Part Number A90125-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Functions, 21 of 166


CONCAT

Syntax

concat::=


Text description of functions33a.gif follows
Text description of concat

Purpose

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 of VARCHAR2 datatype and is in the same character set as char1.

This function is equivalent to the concatenation operator (||).


Note:

When an NCHAR type is concatenated with a CHAR type, the return type is NCHAR, because the conversion from CHAR to NCHAR is lossless. For example, if you concatenate a CLOB with an NCHAR string, the return type is NCLOB


See Also:

"Concatenation Operator" for information on the CONCAT operator 

Example

This example uses nesting to concatenate three character strings:

SELECT CONCAT(CONCAT(last_name, '''s job category is '),
      job_id) "Job" 
   FROM employees 
   WHERE employee_id = 152;
 
Job
------------------------------------------------------
Hall's job category is SA_REP

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback