CREATE OR REPLACE VIEW myview
as
select * from books where price>30
with check option --检查视图的选项
with read only; --只用来更新
/
--创建同义词
create synonym dept from scott.dept
--删除
drop synonym dept
--创建公共同义词
create public synonym dept from scott.dept
--创建序列
create sequence myseq
start with 1
increment by 1
order
nocycle
/
select myseq.NEXTVAL from dual;
select myseq.currval from dual;
--使用序列
create table auto(a number,b varchar2(10));
insert into auto values(myseq.nextval,'de');
--查询序列详情
desc dba_sequences
select sequence_name.sequence_owner from dba_sequences where sequence_owner='system';