1
Dim stSQL as String = "Select ID From Table Where COL Is Null"
Dim cmd As New OracleCommand
cmd.Connection = ...
cmd.CommandText = stSQL
cmd.BindByName = True
Try
Dim oRet As Object = cmd.ExecuteScalar
If oRet IsNot Nothing Then
If oRet > 0 Then
...
End If
End If
Catch ex As Exception
Throw ex
End Try
如果我更改SQL字符串使用參數:
Dim stSQL as String = "Select ID From Table Where COL = :COL"
and add:
cmd.Parameters.Add(New OracleParameter("COL", DBNull.Value))
它不工作...(ORET =沒有)任何想法? -謝謝。
甲骨文12C,VS2017,Oracle.DataAccess v4.112.3.0