在我这里(oracle8.1.5)没问题啊,
SQL> declare
  2  test int;
  3      teststr varchar2(10);
  4      testint int;    
  5  begin
  6     test :=1;
  7     teststr :=to_char(test);    
  8     DBMS_OUTPUT.PUT_LINE(TO_CHAR(test));
  9  end;
 10  /
1PL/SQL 过程已成功完成。

解决方案 »

  1.   

    It should be no error .
      

  2.   

    declare
    month int;
    monthstr varchar2(10);
    begin
    month :=2; 
    monthstr :=to_char(2);  ---正常
    monthstr :=to_char(month); --错误
    DBMS_OUTPUT.PUT_LINE(monthstr);
    end;
    /
     出现符号“)”在需要下列之一时 from
      不用month直接用2 就可以,为什么啊, ?
      

  3.   

    你这个现象是由于 to_char 函数造成的(TO_CHAR (date conversion) )。
    这时定义的 month 数据库系统认为是格式符。
    你重定义变量名为 month1 就没有这个问题了。
      

  4.   

    当变量名为month时的确会出错,但是把month改名为month2时就能够正常运行。因此,怀疑month可能是有其他特殊用途的吧……
    你改个名试试。