储存过程入门08--视图,同义词,序列

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';

你可能感兴趣的:(同义词)