我用语句 adoquery.sql.add(‘update tab1 set aa='+edit1.Text+'');更新aa字段(aa为number类型),edit1.txt= 102.32,但运行提示“ '102.32'is not a valid integer value',错误,请问应该怎么写sql语句?

解决方案 »

  1.   

    你输入 edit1.Text 中的值为 102.32 而 aa 字段是整型的,数据类型不匹配
      

  2.   

    类型不匹配。看看你数据库中的字段类型,看看你是否指定number类型的范围和精度
      

  3.   

    aa 字段是number 型,请问如何指定number类型的范围和精度?
      

  4.   

    decimal and numeric
    Numeric data types with fixed precision and scale.decimal[(p[, s])] and numeric[(p[, s])]Fixed precision and scale numbers. When maximum precision is used, valid values are from - 10^38 +1 through 10^38 - 1. The SQL-92 synonyms for decimal are dec and dec(p, s).p (precision)Specifies the maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision. The maximum precision is 38.s (scale)Specifies the maximum number of decimal digits that can be stored to the right of the decimal point. Scale must be a value from 0 through p. The default scale is 0; therefore, 0 <= s <= p. Maximum storage sizes vary, based on the precision.
      

  5.   

    给你个简单的例子;
    create table tablename 
    (
      aa numeric(5,2)
    )insert into tablename
    values(1.11)select * from tablename