0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

OracleSQL備忘録

Last updated at Posted at 2021-06-09

#OracleSQL 困ったときに

##カラム名が間違ってた!

TEST.sql
ALTER TABLE テーブル名 RENAME COLUMN 元のカラム名 TO 変更後のカラム名

ALTER TABLE TEST RENAME COLUMN NAME TO VALUE

##文字型が間違ってた!

TEST.sql
ALTER TABLE テーブル名 MODIFY (カラム名 変更後の文字型)

ALTER TABLE TEST MODIFY (NAME VARCHAR2(20))

##シーケンスの中身を確認したい

SELECT * from USER_SEQUENCES WHERE SEQUENCE_NAME = 'シーケンス名'

##シーケンスを特定の数字分加算したい

ALTER SEQUENCE シーケンス名 INCREMENT BY 数字 nocache

ALTER SEQUENCE TEST INCREMENT BY 1000 nocache
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?