뷰 생성 예-단순 뷰

 

*사용예

-학생 테이블에서 101번 학과 학생들의 학번, 이름, 학과 번호로 정의되는 단순 뷰를 생성하여라.

 

SQL> create view v_stud_dept101

  2   as select studno, name, deptno

  3   from student

  4   where deptno = 101;

create view v_stud_dept101

 

1행에 오류:

ORA-01031 : 권한이 불충분합니다

 

SQL> sho user

USER은 "SCOTT"입니다

SQL> connect/ as sysdba

SQL> grant create view to scott;

 

권한이 부여되었습니다.

 

SQL> connect scott/tiger

연결되었습니다.

SQL> create view v_stud_dept101

  2   as select studno, name, deptno

  3   from student

  4   where deptno = 101;

 

뷰가 생성되었습니다.

 

 

 

 

+ Recent posts