共計(jì) 966 個(gè)字符,預(yù)計(jì)需要花費(fèi) 3 分鐘才能閱讀完成。
這篇文章主要講解了“Oracle 表列字段的增加、刪除、修改以及重命名操作”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著丸趣 TV 小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“Oracle 表列字段的增加、刪除、修改以及重命名操作”吧!
增加字段語(yǔ)法:alter table tablename add (column datatype [default value][null/not null],….);
說(shuō)明:alter table 表名 add (字段名 字段類型 默認(rèn)值 是否為空);
例:alter table sf_users add (HeadPIC blob);
例:alter table sf_users add (userName varchar2(30) default 空 not null);
修改字段的語(yǔ)法:alter table tablename modify (column datatype [default value][null/not null],….);
說(shuō)明:alter table 表名 modify (字段名 字段類型 默認(rèn)值 是否為空);
例:alter table sf_InvoiceApply modify (BILLCODE number(4));
刪除字段的語(yǔ)法:alter table tablename drop (column);
說(shuō)明:alter table 表名 drop column 字段名;
例:alter table sf_users drop column HeadPIC;
字段的重命名:
說(shuō)明:alter table 表名 rename column 列名 to 新列名 (其中:column 是關(guān)鍵字)
例:alter table sf_InvoiceApply rename column PIC to NEWPIC;
表的重命名:
說(shuō)明:alter table 表名 rename to 新表名
例:alter table sf_InvoiceApply rename to sf_New_InvoiceApply;
感謝各位的閱讀,以上就是“Oracle 表列字段的增加、刪除、修改以及重命名操作”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì) Oracle 表列字段的增加、刪除、修改以及重命名操作這一問(wèn)題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是丸趣 TV,丸趣 TV 小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!