- CREATE TABLE Student
- (Sno CHAR(9) PRIMARY KEY,
- Sname CHAR(20) NOT NULL,
- Ssex CHAR(4),
- Sage SMALLINT,
- Sdept CHAR(20)) tablespace gaospace;
如上面student表的定义。
游标定义: cursor 游标名 is select 语句;
- declare
- v_student_name char(20);
- Cursor c_student is select sname from student;
- begin
- open c_student;
- loop
- fetch c_student into v_student_name;
- exit when c_student%notfound;
- dbms_output.put_line(v_student_name);
- end loop;
- close c_student;
- end;
发现在记事本里面敲入上面的代码,然后再粘贴复制到sqlplus上面去,报错:
*
第 3 行出现错误:
ORA-06550: 第 3 行, 第 1 列:
PLS-00103: 出现符号 "?"在需要下列之一时:
begin function
pragma procedure subtype type
current cursor delete
exists prior
符号 "?" 被忽略。
ORA-06550: 第 4 行, 第 1 列:
PLS-00103: 出现符号 "?"在需要下列之一时:
begin function
pragma procedure subtype type
转载于:http://blog.itpub.net/26435490/viewspace-1077594/