0

I am create a tool to migration all data and schema from MsSqlServer to Oracle.

The .Net library used is EntlibContrib.Data.OdpNet.

While it execute CREATE table:

OracleDatabase db = new OracleDatabase(connectionString);
string createDDL = "CREATE TABLE APPInvoiceItems (ABC RAW(16));";
db.ExecuteNonQuery(createDDL);

I got an exception:

ORA-00931: missing identifier
ORA-06512: at "SYS.DBMS_UTILITY", line 156
ORA-06512: at line 1

I have searched several topics but wasn't able to find a solution

1 Answer 1

1

You appear to be calling the wrong overload of the OracleDatabase.ExecuteNonQuery method.

There are five overloads of this method, all inherited from the superclass, Database. The overload that you are calling takes a stored procedure name and a params array of objects for the stored-procedure parameters. The error arises because your DDL statement isn't a valid name for a stored procedure.

I found that using the following overload worked:

db.ExecuteNonQuery(CommandType.Text, createDDL);

(CommandType requires using System.Data.)

Additionally, you will need to remove the semicolon at the end of your DDL statement. Otherwise you will get the error ORA-00911: invalid character.

Sign up to request clarification or add additional context in comments.

1 Comment

You are right but not enough, we need add TABLESPACE at the end of command too. Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.