create or replace procedure tic_wt_jwjpad
IS
begin
 declare   @n  integer
 set @n = 0
 while @n <= 360
 begin
    select n_zyid, n_year, sum(f_frequency) from
      (select b.f_azimuth, b.f_geoangle, a.*
      from t_tic_wt_jwjpad a, t_enum_winddrc b
      where a.c_direction = b.c_direction)
    where f_azimuth between @n and @n+45
    group by n_year, n_zyid
    @n = @n + 22.5
 end
end tic_wt_jwjpad;上述存储过程为什么会在编译的时候报告Compilation errors for PROCEDURE PDMAM.TIC_WT_JWJPADError: PLS-00103: 出现符号"@"在需要下列之一时
        begin function package pragma
          procedure subtype type use <an identifier>
          <a double-quoted delimited-identifier> form current cursor
Line: 4
Text: declare   @n  integer这样的错误。。望高手解答。谢谢!

解决方案 »

  1.   

    integer类型的数值 +22.5???
      

  2.   

    把declare @n integer行删除。
      

  3.   

    declare   @n  integer------------------------declare n int;
      

  4.   

    感谢楼上兄弟们的回答。由于这几天出差没有来CSDN将  declare   @n  integer
    改成
    declare   @n  double 或者  declare   @n  float出现上面同样的错误========================将 declare   @n  integer
    改成
    declare n int;//////出现下列错误Compilation errors for PROCEDURE PDMAM.TIC_WT_JWJPADError: PLS-00103: 出现符号"SET"在需要下列之一时
            precision
    Line: 5
    Text: set @n = 0==========================把declare @n integer行删除。///////出现下列错误 Compilation errors for PROCEDURE PDMAM.TIC_WT_JWJPADError: PL/SQL: ORA-00922: 缺少或无效选项
    Line: 4
    Text: set @n = 0Error: PL/SQL: SQL Statement ignored
    Line: 4
    Text: set @n = 0Error: PLS-00103: 出现符号 "end-of-file"在需要下列之一时
            begin case declare
              end exception exit for goto if loop mod null pragma raise
              return select update while with <an identifier>
              <a double-quoted delimited-identifier> <a bind variable> <<
              close current delete fetch lock insert open rollback
              savepoint set sql execute commit forall merge
              <a single-quoted SQL string> pipe
    Line: 16=============希望大家能帮我调试一下啊。。谢谢了
      

  5.   

    DELIMITER $$;
    create or replace procedure tic_wt_jwjpad()
    begin
    declare n integer;
    set n = 0;
    while n <= 360
    begin
    select n_zyid, n_year, sum(f_frequency) from
    (select b.f_azimuth, b.f_geoangle, a.*
    from t_tic_wt_jwjpad a, t_enum_winddrc b
    where a.c_direction = b.c_direction)
    where f_azimuth between n and n+45
    group by n_year, n_zyid;
    n = n + 22.5;
    end$$
    DELIMITER ;$$
      

  6.   

    呵呵,是有错误
    难道是我的PL/SQL 有问题?