Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

데이터 입력

휘발성 테이블의 데이터 입력은 다음과 같다.

...

iFlux> create volatile table vtable (id integer primary key, direction varchar(10), refcnt integer);
Created successfully.
iFlux> insert into vtable values(1, 'west', 0);
1 row(s) inserted.
iFlux> insert into vtable values(2, 'east', 0);
1 row(s) inserted.
iFlux> select * from vtable;
ID          DIRECTION   REFCNT      
----------------------------------------
1           west        0           
2           east        0           
[2] row(s) selected.

iFlux> insert into vtable values(1, 'west', 0) on duplicate key update set refcnt = 1;

1 row(s) inserted.
iFlux> select * from vtable;
ID          DIRECTION   REFCNT      
----------------------------------------
1           west        1           
2           east        0           
[2] row(s) selected.
iFlux>


 

데이터 삭제

휘발성 테이블은 조건 절(WHERE 절)에서 기본 키 값 조건을 이용해 이용해 데이터를 삭제할 수 있다.

  • 휘발성 테이블에 기본 키 컬럼이 지정되어 있어야 한다.

  • (기본 키 컬럼) = (값)의 조건만 허용하며, 다른 조건과 함께 사용할 수 없다.

  • 기본 키 컬럼이 아닌 다른 컬럼을 사용할 수 없다.

...

 

데이터 조회

데이터 조회는 다른 테이블 유형과 마찬가지로, 아래와 같이 수행할 수 있다.

...