010数据插入 到oracle数据库里出现10怎么解决

解决方案 »

  1.   

    呵呵:肯定是将字符串类型的数值插入到了number类型的字段中去了......
      

  2.   

    将010数据定义成varchar类型的 数值型的话 只能是10
      

  3.   

    在插入的数据两端加上引号SQL> create table t1(id varchar2(10));Table created.SQL> insert into t1 values(0101);1 row created.SQL> select * from t1;ID
    ----------
    101SQL> insert into t1 values('0101');1 row created.SQL> select * from t1;ID
    ----------
    101
    0101
      

  4.   

    并且要确认表中的列是字符型
    如果是数值型 那是无法插入010的
    SQL> create table t1(id number);Table created.SQL> insert into t1 values(010);1 row created.SQL> select * from t1;        ID
    ----------
            10SQL> insert into t1 values('010');1 row created.SQL> select * from t1;        ID
    ----------
            10
            10
      

  5.   

    嗯,楼上得说的不错
    插数字到字符型,如果不加单引号,oracle会用 to_char给你转义,而to_char里面当数字得时候前面得0会去掉得