我是在PL/SQL Devloper下面写的这段代码,但是报错“必须申明标识符 hundreds_counter”,我申明了呀,
请问哪里错了,谢谢
set echo on
set serveroutput on
--Count up by hundreds until we get an error.
declare
-- Note that with a scale of -2 this variable can only
--hold values like 100,200,300...up to 900.
hundreds_counter number(1,-2);
begin
hundreds_counter:=100;
loop
dbms_output.put_line(hundreds_counter);
hundreds_counter:=hundreds_counter+100;
end loop;
exception
when others then
dbms_output.put_line('That is as high as we can go.');
end;
请问哪里错了,谢谢
set echo on
set serveroutput on
--Count up by hundreds until we get an error.
declare
-- Note that with a scale of -2 this variable can only
--hold values like 100,200,300...up to 900.
hundreds_counter number(1,-2);
begin
hundreds_counter:=100;
loop
dbms_output.put_line(hundreds_counter);
hundreds_counter:=hundreds_counter+100;
end loop;
exception
when others then
dbms_output.put_line('That is as high as we can go.');
end;
解决方案 »
- ORACLE服务未启动时,无法通过sqlplus启动服务
- 某段时间总数统计
- oracle表中主关键字数据库系统自动产生怎么设置?
- 这个日期怎么插?高手指点!
- oracle ORA-09817
- 重新启动数据库时主机身份证明是什么?
- oracle8.05 一存储过程语句错误,怎么从备份语句中单独恢复这一个存储过程,在线等待
- 我要用Exp导出数据,但不要表结构(只要数据),能实现否?
- 为什么我的oracle8中的sql*plus里面不能运行sqlldr?
- Oracle中如何实现SQL Server中的那种自动增长的数据类型!?
- oracle10g ome无法通过网页启动
- 求救:access连接oracle,不能显示中文!
2 -- Note that with a scale of -2 this variable can only
3 --hold values like 100,200,300...up to 900.
4 hundreds_counter number(1,-2);
5 begin
6 hundreds_counter:=100;
7 loop
8 dbms_output.put_line(hundreds_counter);
9 hundreds_counter:=hundreds_counter+100;
10 end loop;
11 exception
12 when others then
13 dbms_output.put_line('That is as high as we can go.');
14 end;
15 /
PL/SQL procedure successfully completed
SQL> set serveroutput on;
SQL> /
100
200
300
400
500
600
700
800
900
That is as high as we can go.
PL/SQL procedure successfully completed
SQL>
2 hundreds_counter number(1,-2);
3 begin
4 hundreds_counter:=100;
5 loop
6 dbms_output.put_line(hundreds_counter);
7 hundreds_counter:=hundreds_counter+100;
8 end loop;
9 exception
10 when others then
11 dbms_output.put_line('That is as high as we can go.');
12 end;
13 /
100
200
300
400
500
600
700
800
900
That is as high as we can go.
PL/SQL procedure successfully completed