我试验过了,是7位,用length()测试的,不知道为什么!

解决方案 »

  1.   

    还有啊,比如:SELECT to_char(inmoneyid.nextval,'') FROM dual显示一个#,
    SELECT to_char(inmoneyid.nextval,'00') FROM dual显示两个#.....
    只要0的个数,不够inmoneyid.nextval实际值的长度,全是#!
      

  2.   

    SELECT length(to_char(inmoneyid.NEXTVAL)) FROM dual显示出来是正确的长度!
      

  3.   

    前面的空格其实是符号位,用下面的方法可以去掉
    select to_char(inmoneyid.nextval,'fm000000');
      

  4.   

    shine333(enihs)  is right
      

  5.   

    官方解释:
    FM
    "Fill mode". This modifier suppresses blank padding in the return value of the TO_CHAR function:In a datetime format element of a TO_CHAR function, this modifier suppresses blanks in subsequent character elements (such as MONTH) and suppresses leading zeroes for subsequent number elements (such as MI) in a date format model. Without FM, the result of a character element is always right padded with blanks to a fixed length, and leading zeroes are always returned for a number element. With FM, because there is no blank padding, the length of the return value may vary. 
    In a number format element of a TO_CHAR function, this modifier suppresses blanks added to the left of the number, so that the result is left-justified in the output buffer. Without FM, the result is always right-justified in the buffer, resulting in blank-padding to the left of the number. 
      

  6.   

    shine333(enihs)已经是正解,我想不需要大家在发表意见了。