본문 바로가기

Programming/Oracle22

scott / tiger 먼저 테이블을 확인해보자. emp 테이블을 보자. 최근 고용일 순으로 정렬. rownum 은 정렬 전의 값을 보여주는 구나. 그럼 다시, 정렬 후에 rownum 출력. 그런데 여기서, between 을 주기를 하면....... 정렬 전의 rownum 을 기준으로 가져오네, 이러면 안된다.! (뮤라가 넘겨준) 의문의 쿼리!!!!! 그래서, 최근 입사한 직원순으로 6~10번째 직원들 정보가 나오도록 수정. 2012. 2. 29.
오라클 컬럼 추가. #####################테스트를 위한 테이블 생성################################SQL> create table test (  2  name varchar(10)  3  );테이블이 생성되었습니다.

2012. 2. 6.

오라클 인덱스 명 바꾸기 ALTER INDEX PREVIOUS_INDEX_NAME RENAME TO POST_INDEX_NAME 2011. 12. 9.
Alter Oracle Column ALTER TABLE 구테이블명 RENAME TO 신테이블명; ALTER TABLE [TABLE NAME] RENAME COLUMN [COLUMN NAME] TO [NEW COLUMN NAME]; 컬럼명 바꾸기ALTER TABLE high_tax RENAME COLUMN year_comm TO tax ; 컬럼수정alter table high_tax modify ( tax number(10,2) ) ; 컬럼 삭제Alter table high_tax Drop ( tax ); 컬럼추가Alter table high_tax add ( tax number(10,2) default 2000 ); 2011. 11. 28.
TRIGGER 사용 시 MUTATING ERROR(ORA-4091) 해결책 출처: https://forums.oracle.com/forums/thread.jspa?threadID=466812 1) PL/SQL table을 생성한다. SQL) create or replace PACKAGE emp_pkg as TYPE emp_tab_type is table of EMP.DEPTNO%TYPE index by binary_integer; emp_old emp_tab_type; emp_new emp_tab_type; emp_index binary_integer; end emp_pkg; / Package created. 2) BEFORE STATEMENT trigger를 생성한다. SQL)create or replace TRIGGER emp_bef_stm_all before insert .. 2011. 11. 28.
PL/SQL User's Guide and Reference 출처:https://forums.oracle.com/forums/thread.jspa?threadID=466812 PL/SQL User's Guide and Reference Library Product Contents Index PL/SQL Tables and User-Defined Records PL/SQL Tables User-Defined Records Knowledge is that area of ignorance that we arrange and classify.Ambrose Bierce In Chapter 2, you learned about the PL/SQL scalar datatypes, which can store only one item of data. In this chapter.. 2011. 11. 25.