alter table oracle
ALTER TABLE tablename MODIFY columnname varchar2(100)
alter table oracle
ALTER TABLE tablename MODIFY columnname varchar2(100)
oracle rename column
ALTER TABLE my_table RENAME COLUMN old_name TO new_name;
-- To check if column exists before renaming it:
DECLARE
l_cnt INTEGER;
BEGIN
SELECT count(*) INTO l_cnt
FROM dba_tab_columns -- or all_tab_columns (depending on grants)
WHERE owner = 'my_schema' AND table_name = 'my_table'
AND column_name = 'my_col';
IF (l_cnt = 1) THEN
EXECUTE IMMEDIATE 'ALTER TABLE my_table
RENAME COLUMN my_col TO my_new_name';
END IF;
END;
alter table oracle
ALTER TABLE table_name
ADD CONSTRAINT constraint_name
FOREIGN KEY (column1, column2, ... column_n)
REFERENCES parent_table (column1, column2, ... column_n);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us