Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Location
    Munich, Germany
    Posts
    35

    Unanswered: Mapping question

    Hi all,

    A small mapping question. Is the SQL Server data type 'real' equal to Oracledata type 'FLOAT'? I am wondering whether to convert real to float or Oracle number. When I use number, it seems to truncate the value after the decimal point.

    Thanks,

    Pankaj

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    NUMBER without a specified precision and scale does not truncate:
    Code:
    SQL> create table t1 (n number);
    
    Table created.
    
    SQL> insert into t1 values (1.2345678901234567890);
    
    1 row created.
    
    SQL> select * from t1;
                                           N
    ----------------------------------------
                        1.234567890123456789
    But if you specify a precision without a scale, then Oracle defaults the scale to 0:
    Code:
    SQL> create table t2 (n number(30));
    
    Table created.
    
    SQL> insert into t2 values (1.2345678901234567890);
    
    1 row created.
    
    SQL> select * from t2;
    
                                           N
    ----------------------------------------
                                           1
    FLOAT is not a "native" Oracle datatype, rather it exists for ANSI compatibility. It is documented here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •