第 19 行出现错误:PLS-00103:遇到符号“¿”

问题描述 投票:0回答:1

此过程出现以下错误。

create or replace procedure shedule(grad IN varchar2) as
    cursor cur(grad varchar2) is 
        select s.departments dep, s.groups gr, dis.disc_name diname, t.teach_fio teacher, s.type, s.exam_date,s.exam_time, s.kabinet
        from sessions10 s, disciplines10 dis, teachers10 t
        where dis.disc_id = s.disc_id and t.teach_id = s.teach_id 
        order by s.groups
    schrow cur%ROWTYPE;
        departments varchar2(15);
        groups      number(10);
        disciplines varchar2(15);
begin 
    DBMS_OUTPUT.enable;
    for schrow in cur(grad) LOOP
        departments := schrow.dep;
        groups := schrow.gr;
        disciplines := schrow.diname;
        dbms_output.put_line(departments||' '||groups||' '||disciplines||' '||schrow.teacher||);
    end LOOP;
end;​

给出:

ERROR at line 19: PLS-00103: Encountered the symbol "¿" 
1. create or replace procedure shedule(grad IN varchar2) as
2.     cursor cur(grad varchar2) is 
3.         select s.departments dep, s.groups gr, dis.disc_name diname, t.teach_fio teacher, s.type, s.exam_date,s.exam_time, s.kabinet

谁能说一下这有什么问题吗?

谢谢。

在sql中创建过程。

oracle10g
1个回答
0
投票

两个明显的错误:

  • 第 6 行缺少分号
  • #17 行末尾的
  • 多余
    ||

修复后:

create or replace procedure shedule(grad IN varchar2) as
    cursor cur(grad varchar2) is 
        select s.departments dep, s.groups gr, dis.disc_name diname, t.teach_fio teacher, s.type, s.exam_date,s.exam_time, s.kabinet
        from sessions10 s, disciplines10 dis, teachers10 t
        where dis.disc_id = s.disc_id and t.teach_id = s.teach_id 
        order by s.groups; --> missing semi-colon
        schrow cur%ROWTYPE;
        departments varchar2(15);
        groups      number(10);
        disciplines varchar2(15);
begin 
    DBMS_OUTPUT.enable;
    for schrow in cur(grad) LOOP
        departments := schrow.dep;
        groups := schrow.gr;
        disciplines := schrow.diname;
        dbms_output.put_line(departments||' '||groups||' '||disciplines||' '||schrow.teacher);  --> superfluous ending ||
    end LOOP;
end;​

不过,你举报了

遇到符号“¿”

该代码中有任何“垃圾”吗?尝试删除第 17 行之后的所有内容并从头开始输入。

© www.soinside.com 2019 - 2024. All rights reserved.