how do you add commas and dollar sign to the value of a table?

This nature can be derived using the NLS setting.

You can alter the NLS_LANGUAGE and NLS_TERRITORY for your session and use the TO_CHAR function to achieve the desired behavior as follows:

SQL> alter session set NLS_LANGUAGE=AMERICAN;

Session altered.

SQL> alter session set NLS_TERRITORY=AMERICA;

Session altered.

SQL>
SQL> SELECT TO_CHAR(1800,'L99G999D00') salary FROM DUAL;

SALARY
--------------------
           $1,800.00

SQL>

You can see current NLS setting using following Views:

  1. NLS_SESSION_PARAMETERS
  2. NLS_DATABASE_PARAMETERS
  3. NLS_INSTANCE_PARAMETERS

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top