如何在oracle 11g 中将表名和列设置为区分大小写? [英] How to set table names and columns as case sensitive in oracle 11g?

查看:41
本文介绍了如何在oracle 11g 中将表名和列设置为区分大小写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 .NET 4.0 应用程序,它使用连接到 MS SQL 2008 数据库的实体框架 4.使用的命名约定是例如表Clients",字段:Id"、Id_Order".现在我需要从SQL Server切换到Oracle Server,所以我将MS SQL数据库迁移到oracle数据库,但问题是所有的表名和列名都是大写的,所以通过为oracle生成edmx(使用ODAC),我将不得不将代码从Clients"更改为CLIENTS",将Id"更改为ID",将Id_Client"更改为ID_CLIENT",并且要更改很多.迁移是使用 Oracle SQL Developer 3.1.07 的内置迁移工具完成的.

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 ?

推荐答案

为什么需要更改代码?Oracle 不区分大小写的全部意义在于您可以将表称为 clientsClientsCLIENTS,甚至 客户端,它会起作用.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆