1. Change the table name and field name to uppercase see-http://www.cnblogs.com/wenboge/articles/4121331.html
2. Change the table name and field name to lowercase
① change table name to lowercase
begin forCinch(SelectTABLE_NAME TN fromUser_tableswheretable_name<> Lower(table_name)) Loopbegin ExecuteImmediate'ALTER TABLE'||C.tn||'Rename to "'||Lower(c.tn)||'"'; Exception whenOthers ThenDbms_output.put_line (c.tn||'already exists'); End; EndLoop;End;
② field is named lowercase
begin forTinch(SelectTABLE_NAME TN fromuser_tables) Loopbegin forCinch(SelectCOLUMN_NAME CN fromUser_tab_columnswheretable_name=t.tn) Loopbegin ExecuteImmediate'ALTER TABLE'||T.tn||'Rename Column'||c.cn||'To "'||Lower(c.cn)||'"'; Exception whenOthers ThenDbms_output.put_line (t.tn||'.'||c.cn||'already exists'); End; EndLoop; End; EndLoop;End;
Note:
1. If the fields and table names are changed to lowercase, change the fields first and then change the table.
2. If the table name gets the field name to lowercase, enclose the table and field names in the query statement with double quotation marks
Cases.
Table name lowercase: SELECT * from "department";
Field name lowercase: select "id" from "department";
And I don't know why.
In Oracle, change the case of table names and field names