简体   繁体   中英

Changed column name to upper case when create a new table through script in Oracle how to resolve this?

I am using Oracle tool (Oracle SQL Developer - Version 19.2.1.247). When i create new table in Oracle Db then it change all column name in uppercase ie(CUSTOMERID), but i want to keep column name ie(CustomerId).I am looking for solutions how to resolve this.

I did some try to change formatting of editor as well code setting in Tools -> Preference but not found any proper things.

Thanks in advance.

You should avoid doing that. Every object ( table, column, index, sequence, trigger... ) is stored in uppercase in the Oracle dictionary.

However, if you want to store the name in lowercase, you must use double quotation

SQL> create table test ( c1 number );

Table created

SQL> select column_name from all_tab_columns where table_name = 'TEST';

COLUMN_NAME
C1

SQL> create table test ( "c1" number );

Table created

SQL> select column_name from all_tab_columns where table_name = 'TEST';

COLUMN_NAME
c1 

Keep in mind that if you store the value in lowercase, any search or program that uses the dictionary will have to take this in consideration. That is why I believe it is not a good practice.

Oracle has a default functionality where it will convert all unquoted table/column identifiers to upper case, therefore add double quotes around the names should resolve your issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM