Problem Inserting into oracle database

Posts   
 
    
Wcrowe
User
Posts: 4
Joined: 26-Aug-2004
# Posted on: 26-Aug-2004 20:32:08   

I have a table that uses sequence ids that I am trying to insert records into... I don't no if this is the problem, but the exception I am getting back is from the Oracle.DataAccess... The message is - InnerException {"Value cannot be null.\r\nParameter name: value" } System.Exception I don't have a column named value, and I know if I try to insert a value in a column that doesn't allow nulls I get back the same exception, but with the name of a valid column... Client version is the 9.2.0.1.0 Dot net provider is 9.2.0.4.01

Any help would be much appreciated...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 26-Aug-2004 22:40:24   

Wcrowe wrote:

I have a table that uses sequence ids that I am trying to insert records into... I don't no if this is the problem, but the exception I am getting back is from the Oracle.DataAccess... The message is - InnerException {"Value cannot be null.\r\nParameter name: value" } System.Exception I don't have a column named value, and I know if I try to insert a value in a column that doesn't allow nulls I get back the same exception, but with the name of a valid column... Client version is the 9.2.0.1.0 Dot net provider is 9.2.0.4.01 Any help would be much appreciated...

Do you specify for each field in your entity a value? if not, those fields, can these fields be NULL? Are you sure you have set the sequence in the designer for the sequenced field? (sorry for the silly questions, but sometimes it's a small thing that causes it to fail simple_smile )

Frans Bouma | Lead developer LLBLGen Pro
Wcrowe
User
Posts: 4
Joined: 26-Aug-2004
# Posted on: 26-Aug-2004 23:22:43   

Yes, I did make sure I did it all... It paramater with an error is named value... I don't even have a column named value

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 26-Aug-2004 23:46:17   

Wcrowe wrote:

Yes, I did make sure I did it all... It paramater with an error is named value... I don't even have a column named value

No, 'value' can also be a term used by ODP.NET, I think that's the case here.

So the sequence is defined in the code, you set all fields to a value, and when you call save you get this error. Do you use adapter or selfservicing? Do you use a recursive save? It's perhaps good to paste some code of the routine which saves the entity. Also what's the stacktrace of the exception?

Frans Bouma | Lead developer LLBLGen Pro
Wcrowe
User
Posts: 4
Joined: 26-Aug-2004
# Posted on: 27-Aug-2004 15:37:15   

I have tried both adapter and selfservining... Recursive save set to true and false... Stack trace of inner exception is _stackTrace {System.Array} System.Object [0] 49 sbyte [1] -99 sbyte [2] -113 sbyte [3] 16 sbyte [4] -36 sbyte [5] -23 sbyte [6] 18 sbyte [7] 0 sbyte [8] 112 sbyte [9] 19 sbyte [10] -59 sbyte [11] 16 sbyte [12] 118 sbyte [13] 115 sbyte [14] -113 sbyte [15] 16 sbyte [16] -96 sbyte [17] -22 sbyte [18] 18 sbyte [19] 0 sbyte [20] 88 sbyte [21] -10 sbyte [22] -2 sbyte [23] 15 sbyte

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 27-Aug-2004 15:54:45   

No, that's not the stacktrace I meant.

I meant the stacktrace property of the exception:


try
{
    // your insert code here
}
catch(ORMQueryExectutionException ex)
{
    // exception ends up here
    Console.WriteLine("Exception caught: {0}", ex.Message);
    Console.WriteLine("Stacktrace: {0}", ex.StackTrace);
    if(ex.InnerException!=null)
    {
        Console.WriteLine("Inner Exception: {0}", ex.InnerException.Message);
    }
    throw;
}

Frans Bouma | Lead developer LLBLGen Pro
Wcrowe
User
Posts: 4
Joined: 26-Aug-2004
# Posted on: 27-Aug-2004 17:27:12   

at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery()\r\n at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute() in c:\program files\solutions design\llblgen pro\runtimelibraries\source\ormsupportclasses\actionquery.

  • ex {"Value cannot be null.\r\nParameter name: value" } System.Exception
  • [System.ArgumentNullException] {"Value cannot be null.\r\nParameter name: value" } System.ArgumentNullException
  • System.ArgumentException {"Value cannot be null.\r\nParameter name: value" } System.ArgumentException _nullMessage "Value cannot be null." string NullMessage "Value cannot be null." string System.Object {System.ArgumentNullException} System.Object _className null string _COMPlusExceptionCode -532459699 int _exceptionMethod <undefined value> System.Reflection.MethodBase _exceptionMethodString null string _helpURL null string _HResult -2147467261 int _innerException { } System.Exception _message "Value cannot be null." string _remoteStackIndex 0 int _remoteStackTraceString null string _source null string
  • _stackTrace {System.Array} System.Object _stackTraceString null string _xcode -532459699 int _xptrs 0 int HelpLink null string HResult -2147467261 int InnerException { } System.Exception Message "Value cannot be null.\r\nParameter name: value" string Source "Oracle.DataAccess" string StackTrace "
    at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery()\r\n at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute() in c:\program files\solutions design\llblgen pro\runtimelibraries\source\ormsupportclasses\actionquery.cs:line 110" string
  • TargetSite {System.Reflection.RuntimeMethodInfo} System.Reflection.MethodBase
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 28-Aug-2004 11:59:49   

I've moved your message to this thread. simple_smile (and please, next time be careful what you paste in the subject simple_smile You pasted the complete message in the subject)

Hmm. Ok, so the actual insert code is causing hte error apparently.

Ok, I'd like to ask you to answer every question I list below so I can determine what's wrong: - Can you insert other entities without problems? - Do you use adapter or selfservicing? - As you've used the sourcecode to debug the matter as it seems, could you set a breakpoint at line 110 in ActionQuery.cs, which is the call to the ExecuteNonQuery() statement and check what the following things are: The SQL being executed and the values for the parameters passed in. You can check these by checking base.Command.CommandText and base.Command.Parameters. It would be great if you could paste here: - the table creation SQL - SQL query - the code you execute to fill the entity and save it.

I'm sure it's something small, but I think especially the last question is key to find out what's wrong.

Frans Bouma | Lead developer LLBLGen Pro