简体   繁体   English

从SQL Server更改为Oracle数据库

[英]Changing from SQL Server to Oracle database

I've been asked to migrate my application from using a SQL Server database to an Oracle database. 我被要求将我的应用程序从使用SQL Server数据库迁移到Oracle数据库。

I'm getting this error: 我收到此错误:

ORA-00942: table or view does not exist ORA-00942:表或视图不存在

I could be wrong, but I believe this is an issue with my statement. 我可能是错的,但是我认为这是我的陈述中存在的问题。 Is there a specific format I would need to follow connected to an oracle database over a SQL Server? 通过SQL Server连接到oracle数据库是否需要遵循特定的格式?

I will include my query statement: 我将包括我的查询语句:

namespace project1
{
    public class dbqry
    {
        private static string qry = "";


        public static DataTable gProjectCIS(string BSA_CD)
        {
            qry = string.Format(@"SELECT *
                    FROM CIS_TRANS
                    WHERE BSA_CD like '%{0}%'", BSA_CD);

            return dbcon.GetDataTable(qry, "ProjectCISConnectionString");
        }

        public static DataTable gProjectCIS()
        {
            qry = @"SELECT *
                    FROM CIS_TRANS";

            return dbcon.GetDataTable(qry, "ProjectCISConnectionString");
        }

Thanks! 谢谢!

Hello you must prefix your table with schema 您好,您必须为表添加模式

  qry = string.Format(@"SELECT *
         FROM YourSchemaUser.CIS_TRANS <-- Fix your schema user name
         WHERE BSA_CD like '%{0}%'", BSA_CD);

  qry = @"SELECT * FROM YourSchemaUser.CIS_TRANS"; <-- Fix your schema user name

And Fix Package on stored procedure. 并在存储过程中修复程序包。

You change declaration and body, compile your package in the first time before use 您更改声明和正文,在使用前第一次编译您的包

Oracle is picky when it comes to case sensitivity. 在区分大小写方面,Oracle十分挑剔。 If the table was declared with "QUOTES", you'll need to include the quotes in your query and match case. 如果表是用“ QUOTES”声明的,则需要在查询和匹配用例中包括引号。 That's probably a good start. 那可能是一个好的开始。

Check the object names. 检查对象名称。 Also check they are in the correct case. 还要检查它们的大小写是否正确。

Check that the username you are using to connect to the database have permissions over the tables/views you are trying to use. 检查用于连接数据库的用户名是否对您尝试使用的表/视图具有权限。 Oracle usually says that the table does not exist when you don't have the right privileges. Oracle通常会说,如果您没有正确的特权,则该表不存在。

您确定要登录正确的架构吗?

You should check whether the CIS_TRANS table has the appropraite public synonym, something like: 您应该检查CIS_TRANS表是否具有适当的公共同义词,例如:

create or replace public synonym CIS_TRANS for some_user.CIS_TRANS

where some_user is the user which created the CIS_TRANS object. 其中some_user是创建CIS_TRANS对象的用户。

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

相关问题 从本地数据库更改为 SQL 服务器托管在服务器上 - Changing from local database to SQL Server hosted on a server 将丢失的记录从Oracle DB插入SQL Server数据库 - Inserting missing records from Oracle DB into SQL Server database 使用 LINQ 将数据库从 SQL Server 2008 R2 更改为 SQL Server 2008 - Using LINQ changing database from SQL Server 2008 R2 to SQL Server 2008 动态选择SQL Server或Oracle数据库 - Dynamically choose SQL Server or Oracle database 使用Entity Framework将数据库从SQL Server切换到Oracle需要进行哪些更改? - What changes are needed to switch database from SQL Server to Oracle using Entity Framework? 将数据库从嵌入式更改为SQL Server Express后,Entity Framework 4.1代码第一个模型兼容性问题 - Entity Framework 4.1 code first model compatibility issue after changing database from embedded to SQL Server Express 通过.NET与SQL Server和Oracle连接 - Connection with SQL Server and Oracle from .NET 从 SQL 服务器数据库中删除 - Delete from SQL Server database 针对Oracle,Sql Server和Mongodb构建聚合/摘要报告数据库 - Building aggregation/summary reporting database against Oracle, Sql Server and Mongodb 单个实体框架中具有相同模式的Oracle和SQL Server数据库 - Oracle and SQL Server database with same schema in single Entity Framework
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM