G
Guest
I am building a SQL statement for Oracle and need one part of it to read:
, myvar = null, myvar2 = "1", myvar3 = "0", myvar4 = null,
etc.
I am constructing this string using the String object with the following code:
theSQL.Append(" , myvar = " & FormatValue(MyClass.DB_CHAR1, Me.MyVar))
The portion of the FormatValue function that returns the value is (outValue
is the passed variable):
If IsNumeric(outValue) OrElse outValue = Nothing Then
If outValue < 0 Then outValue = vbNull '****** this is the important
part
Else
outValue = "'" & UCase(valueValue) & "'"
End If
return outValue
Whether I use the statement above or "null" or "'null'" or "''" or ""
doesn't matter, outValue return "nothing" (without the quotes) and the string
looks like this:
, myvar = , myvar2 = "1", myvar3 = "0", myvar4 = ,
which, of course, caused the SQL statement in Oracle to fail.
Any ideas on how to get the string object to accept the word "null"?
Thanks,
Don
, myvar = null, myvar2 = "1", myvar3 = "0", myvar4 = null,
etc.
I am constructing this string using the String object with the following code:
theSQL.Append(" , myvar = " & FormatValue(MyClass.DB_CHAR1, Me.MyVar))
The portion of the FormatValue function that returns the value is (outValue
is the passed variable):
If IsNumeric(outValue) OrElse outValue = Nothing Then
If outValue < 0 Then outValue = vbNull '****** this is the important
part
Else
outValue = "'" & UCase(valueValue) & "'"
End If
return outValue
Whether I use the statement above or "null" or "'null'" or "''" or ""
doesn't matter, outValue return "nothing" (without the quotes) and the string
looks like this:
, myvar = , myvar2 = "1", myvar3 = "0", myvar4 = ,
which, of course, caused the SQL statement in Oracle to fail.
Any ideas on how to get the string object to accept the word "null"?
Thanks,
Don