简体   繁体   English

SQL Developer将表名和列名更改为大写

[英]SQL Developer Changes Table and Column Names to Uppercase

I'm learning how to use the current version of Oracle's SQL Developer, however I'm having some issues with the software. 我正在学习如何使用当前版本的Oracle SQL Developer,但是该软件存在一些问题。 Whenever I try to create a new table or edit an existing one, the software automatically changes the table and column names to all uppercase. 每当我尝试创建新表或编辑现有表时,该软件都会自动将表名和列名更改为大写。 I would prefer to keep the table and column names in camel case. 我希望将表名和列名保留为驼峰式。 The worksheet formatting is fine, just not the table editor. 工作表的格式很好,只是不能使用表编辑器。 Is there a way to change this setting? 有没有办法更改此设置?

You can force Oracle to use mixed-case identifiers by surrounding your table and column names in double quotes. 您可以通过将表名和列名用双引号引起来来强制Oracle使用大小写混合的标识符。

CREATE TABLE "myTable" (
  "thisIsAColumn" integer,
  "thisIsAnotherColumn" varchar2(50)
);

However, you really ought not do this. 但是,您实际上不应该这样做。 If you do, then every reference to your table and your column will be case-sensitive and will need to use the same double-quoted identifier. 如果这样做,则对表和列的每个引用都将区分大小写,并且需要使用相同的双引号标识符。 That is, you'd need to do 也就是说,您需要做

SELECT "thisIsAColumn", "thisIsAnotherColumn"
  FROM "myTable"

This sort of thing generally gets annoying quickly particularly when SQL and PL/SQL are generally not case-sensitive languages. 这种事情通常很快就会令人讨厌,尤其是当SQL和PL / SQL通常不区分大小写的语言时。 Future developers that have to maintain your code will likely find it annoying to constantly have to double-quote identifiers and to have to get the case correct when queries against other tables remain case-insensitive. 将来必须维护您的代码的开发人员可能会发现,不断烦恼的是,必须不断对标识符加双引号,并且当对其他表的查询仍然不区分大小写时,必须正确区分大小写。

I think this link for you. 我认为此链接适合您。

The following examples are valid schema object names: 以下示例是有效的架构对象名称:

last_name
horse
hr.hire_date
"EVEN THIS & THAT!"
a_very_long_and_valid_name

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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