Setting stored procedure parameters to null

Posts   
 
    
YvesVD
User
Posts: 177
Joined: 19-Oct-2006
# Posted on: 20-Oct-2006 17:49:13   

We have problems when calling stored procedures with parameter values set to null (with OracleMS driver): the parameter is considered to be missing... I found in MSDN that a System.DBNull should be used instead.

When you send a null parameter value to the server, you must specify DBNull, not null. A null value in the system is an empty object that has no value. DBNull is used to represent null values.

...and it works fine if we set the value to DBNull within the generated code.

So would'nt it be right to change the stored procedure generation templates by adding a test on the value passed to the method: if that value is null, then add the parameter with a DBNull value, else keep the code as is?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39862
Joined: 17-Aug-2003
# Posted on: 20-Oct-2006 18:50:22   

That indeed would be better. I'll add it to the templates.

I pressume the DQE problem with the strings is fixed now?

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39862
Joined: 17-Aug-2003
# Posted on: 23-Oct-2006 10:47:32   

Fixed in next build.

Frans Bouma | Lead developer LLBLGen Pro