• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

SQL datatype comparison help

rh71

No Lifer
field used to be comparing varchar to char such as this and it worked ok:
WHERE firstname = username

now the field is comparing long varchar vs. char:
WHERE thefullname = username

and it's returning this error:
Improper use of a string column, host variable, constant, or
function "". SQLSTATE=42907

Is there any way I can still compare these two fields ? It must be these fields so maybe some kind of conversion function on either of them would work ?

Thanks
 
Did you try casting the char as a varchar?

where thefullname = cast(username as varchar)

I don't know if that's the problem, though. This could be something different, but I'm not sure what.
 
thanks but the cast function created the following error:

SQL0604N The length, precision, or scale attribute for column, distinct type,
structured type, attribute of structured type, function, or type mapping "" is
not valid. SQLSTATE=42611
 
i believe you need to quote the value in strings?
WHERE thefullname = 'username'

don't think the varchar or char matters....
 
Back
Top