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

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

问题描述

我有一个使用连接到MS SQL 2008数据库的实体框架4的.NET 4.0应用程序。所使用的命名约定是例如表客户,字段:Id,Id_Order。现在我需要从SQL Server切换到Oracle Server,所以我将MS SQL数据库迁移到oracle数据库,但问题是所有的表名和列名都是大写的,所以通过生成oracle的edmx(使用ODAC),我必须将代码从客户更改为客户端,ID到ID,Id_Client到ID_CLIENT,这是很大的变化。
迁移是使用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屋!

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