只能这样:
select seq.currval from dual;
其它地方都不能引用seq.currval
select seq.currval from dual;
其它地方都不能引用seq.currval
解决方案 »
- 求指导oracle基本问题,谢谢?
- oracle 分区
- 表空间扩展问题
- 基于B/S结构的应用程序访问oracle问题
- 用Oracle SQL Developer 将MS SQL Server 数据库迁移到 Oracle 11g,“定位源插件”检测失败。
- oracle full join的问题,请高手
- UPDATE语句碰见的问题
- 求关于Scott.emp的SQL查询语句
- 我现在想学ORACLE,请问到哪里下载入门教程?谢谢!
- 谁有Oracle(for linux)版的,我在网上下载的安装时出现乱码!急,急!!!
- orcale如何实现数据追加
- oracle的表名、字段名、constraint名的长度限制分别是多少?
1. The SELECT list of a SELECT statement that is not contained in a subquery,
materialized view, or view
2. The SELECT list of a subquery in an INSERT statement
3. The VALUES clause of an INSERT statement
4. The SET clause of an UPDATE statement
-------------------------------------------
You cannot use CURRVAL and NEXTVAL:
1. A subquery in a DELETE, SELECT, or UPDATE statement
2. A query of a view or of a materialized view
3. A SELECT statement with the DISTINCT operator Pseudocolumns
4.A SELECT statement with a GROUP BY clause or ORDER BY clause
5. A SELECT statement that is combined with another SELECT statement with the
UNION, INTERSECT, or MINUS set operator
6.The WHERE clause of a SELECT statement
7. DEFAULT value of a column in a CREATE TABLE or ALTER TABLE statement
8.The condition of a CHECK constraint
2.获取序号值
获取当前序号:SELECT seq_dft_dyjzls_id.CURRVAL FROM DUAL;
获取下一个序号:SELECT seq_dft_dyjzls_id.NEXTVAL FROM DUAL;
before insert on TABLE1
for each row
begin
select SEQ.nextval into :new.NUMFRGUID from dual;
end;
/
update TABLE1 set GUID=(select max(NUID) from TABLE2)