What is wrong with my code? userid column definition is integer, allownull
var tableSQL = "SELECT * FROM address WHERE userid IN(?,?,?)"
var arguments=[null, 11,12]
var tableDataSet = databaseManager.getDataSetByQuery(dbServerName, tableSQL, arguments,-1)
exception… “Error during evaluation:Wrapped java.lang.RuntimeException: com.servoy.j2db.dataprocessing.DataException: No value specified for parameter 3.”
var tableSQL = "SELECT * FROM address WHERE userid is null or userid IN(?,?)"
var arguments=[11,12]
var tableDataSet = databaseManager.getDataSetByQuery(dbServerName, tableSQL, arguments,-1)
Like Marc and Rob already explained you can’t pass a null as an argument to a prepared statement like that.
Also in SQL you can’t use operators with a NULL since you can only use an operator with a value. NULL is not a value or more specific it’s the absence of a value.
So userid=NULL won’t work. The proper syntax is userid IS NULL.
Like Marc and Rob already explained you can’t pass a null as an argument to a prepared statement like that.
Also in SQL you can’t use operators with a NULL since you can only use an operator with a value. NULL is not a value or more specific it’s the absence of a value.
So userid=NULL won’t work. The proper syntax is userid IS NULL.