2 Replies Latest reply: May 2, 2012 12:24 AM by 850247 RSS

    How to select a vachar2 without approximation

    924787
      Dears

      Can any one help me to select varchar2 without approximation .

      Date+

      *16/04/2012 ;208;       10;     *2.0810E14**+ this one should not be approximatif

      Regards
      Ali
        • 1. Re: How to select a vachar2 without approximation
          Frank Kulash
          Hi, Ali,
          921784 wrote:
          Dears

          Can any one help me to select varchar2 without approximation .
          Sorry, it's unclear what you want.
          VARCHAR2s are never approximated. When you say VARCHAR2, do you mean NUMBER?
          Date+

          *16/04/2012 ;208;       10;     *2.0810E14**+ this one should not be approximatif

          Regards
          Ali
          When SQL*Plus doesn't have room to display a large number, such as 208099876543210, exacly, then it uses scientific notation, as shown above. The number stored in the table is not rounded or approximated.

          By default, SQL*Plus allows 10 characters for displaying NUMBERs. You can change that for an individual column by using the SQL*Plus COLUMN ... FORMAT command, like this:
          COLUMN  col_4   FORMAT   999999999999999
          To change the default amount of space for all NUMBER columns, you can use the SQL*Plus SET NUMWIDTH command:
          SET   NUMWIDTH  15
          Also, instead of displaying a NUMBER, you can use TO_CHAR to explicitly convert it to a VARCHAR2, in whatever format you want:
          SELECT  ...
          ,       TO_CHAR ( col_4
                          , '999999999999999'
                          )    AS f_col_4
          ...
           

          I hope this answers your question.
          If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
          Explain, using specific examples, how you get those results from that data.
          Always say which version of Oracle you're using.
          • 2. Re: How to select a vachar2 without approximation
            850247
            Hi,


            Sorry, your requirement is NOT clear.




            Regards,
            Sailaja