tags:

views:

55

answers:

2

In a SELECT statement I want to convert values to strings ie. SELECT TO_STRING(value).

How can I do this in Oracle SQL?

A: 

SELECT CAST(column_name as data_type) from ...

might work

HTH

Sunny
+7  A: 

You can use either the TO_CHAR or the CAST function:

SELECT TO_CHAR(123.45) FROM DUAL

SELECT CAST(123.45 AS VARCHAR2(10)) FROM DUAL
Phil Ross
If you want a particular format mask, TO_CHAR is appropriate [eg TO_CHAR(1234.5,'999,990.00') ]
Gary