如何在oracle 11g中设置区分大小写的表名和列? [英] How to set table names and columns as case sensitive in oracle 11g?
问题描述
迁移是使用Oracle SQL Developer 3.1.07中的内置迁移工具完成的。
生成脚本的代码段:
CREATE TABLE客户端(
我已经看到,为了创建区分大小写的标识符,您必须使用双引号
所以我认为脚本应该是这样的:
CREATE TABLEClients(
有没有人知道一个迁移工具,它持续维护名字大小写,或至少一个常规选项,我可以在脚本中打开?
为什么需要更改代码?Oracle的不区分大小写的一点是可以参考表格为客户端
,客户端
,客户端
,甚至 clIeNtS
,它将会工作。
如果您想要区分大小写,您只能使用双引号原因,但除非你有表名与情况(颤抖相同),你可以不需要它
I have a .NET 4.0 application that uses Entity Framework 4 that connects to a MS SQL 2008 database. The naming convention used is for example table "Clients", fields : "Id", "Id_Order". Now I need to switch from SQL Server to Oracle Server, so I migrated the MS SQL database to oracle database, but the problem is that all the table names and column names are uppercased, so by generating the edmx for oracle(using ODAC), I will have to change in code from "Clients" to "CLIENTS", "Id" to "ID", "Id_Client" to "ID_CLIENT", and it's a lot to change. The migration was done using the built-in migration tool from Oracle SQL Developer 3.1.07.
A snippet from the generated script: CREATE TABLE Clients (
I have read that in order to create case-sensitive identifiers you must use double quotes. So I think the script should be something like this: CREATE TABLE "Clients" (
Does anyone know a migration tool that perserves names case or at least a general option that I can switch on in the script ?
Why do you need to change the code? The whole point of Oracle being case-insensitive is that you can refer to the table as clients
, Clients
, CLIENTS
, or even clIeNtS
, and it will work.
You only use the double-quotes if you want case-sensitivity for some reason, but unless you have table names that are the same apart from case (shudder), you shouldn't need it.
这篇关于如何在oracle 11g中设置区分大小写的表名和列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!