「Oracle入門」シーケンス(SEQUENCE)を取得する方法
シーケンスを作成
CREATE SEQUENCE MEMBERNO;
シーケンスを変更
ALTER SEQUENCE MEMBERNO CFT;
シーケンスを削除
DROP SEQUENCE MEMBERNO;
シーケンス(NEXTVAL)を取得
SELECT MEMBERNO_SEQ.NEXTVAL FROM DUAL;
INSERT構文
INSERT INTO MEMBER (MEMBERNO, UERNAME, ADDR) VALUES (MEMBERNO.NEXTVAL, 'YAMADA’, 'OOSAKA’);
UPDATE構文
UPDATE MEMBER SET MEMBER_NO = MEMBERNO_SEQ.NEXTVAL WHERE MEMBER_NAME = 'YAMADA’;
シーケンス(CURRVAL)を確認
SELECT MEMBERNO_SEQ.CURRVAL FROM DUAL;