在一个最普通的块里使用序列,出现莫名其妙的错误,请大家帮我看看!谢谢 而我不用块,直接从dual中取值是没问题的SQL> select price_his_key.nextval from dual; NEXTVAL---------- 5 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 SQL> create sequence price_his_key 2 start with 1 3 increment by 1 4 nocycle;序列已创建。SQL> set serverout onSQL> declare 2 log_seq_num integer; 3 begin 4 select price_his_key.nextval into log_seq_num from dual; 5 dbms_output.put_line(log_seq_num); 6 end; 7 /1PL/SQL 过程已成功完成。应该没问题的 看看你dual表里有几条数据? 如果不是1条的话必然出错 select * from dual;看看是否dual 表有问题. 和有钱的日子的操作一墨一样SQL> drop sequence price_his_key 2 /序列已丢弃。SQL> create sequence price_his_key 2 start with 1 3 increment by 1 4 nocycle;序列已创建。SQL>SQL> declare 2 log_seq_num integer; 3 begin 4 select price_his_key.nextval into log_seq_num from dual; 5 dbms_output.put_line(log_seq_num); 6 end; 7 8 /declare*ERROR 位于第 1 行:ORA-01422: 实际返回的行数超出请求的行数ORA-06512: 在line 4SQL> select * from dual;D-XSQL> SQL> select count(*) from dual; COUNT(*)---------- 2SQL> 使用PL/SQL 导出用户对象后 怎么导入? 向各位求助,关于连接列值的问题 急求oracle_sql分组统计 怎样把sqlserver的事务处理存储过程转为oracle实现,谢谢!!! 父表与子表(外键) ORACLE表利用序列实现自增字段的问题 这样的字符串应该怎样截取,想炸了脑子... 求助!如下SQL语句怎么写 ? 谢谢 简单Select 语句 求教shared pool duration特性的作用是啥? 【请教】这样的应用用触发器来实现好吗?谢谢 Vc ADO连接Oracle 数据库打包问题?
2 start with 1
3 increment by 1
4 nocycle;序列已创建。SQL> set serverout on
SQL> declare
2 log_seq_num integer;
3 begin
4 select price_his_key.nextval into log_seq_num from dual;
5 dbms_output.put_line(log_seq_num);
6 end;
7 /
1PL/SQL 过程已成功完成。应该没问题的
看看是否dual 表有问题.
2 /序列已丢弃。SQL> create sequence price_his_key
2 start with 1
3 increment by 1
4 nocycle;序列已创建。SQL>
SQL> declare
2 log_seq_num integer;
3 begin
4 select price_his_key.nextval into log_seq_num from dual;
5 dbms_output.put_line(log_seq_num);
6 end;
7
8 /
declare
*
ERROR 位于第 1 行:
ORA-01422: 实际返回的行数超出请求的行数
ORA-06512: 在line 4
SQL> select * from dual;D
-
XSQL>
----------
2SQL>