0
votes

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

1 Answers

1
votes

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.