MSSQL error: The data types text and varchar are incompatible in the equal to operator.
In the ColdFusion administrator under there is the option to save CLIENT variables as cookies, in the registry, a datasource or not at all.
If the client variables are stored as cookies, it is fairly easy to retrieve and parse to determine things like the identity of a returning user from the cookie. This cookie is called CFCLIENT_<cfapplication name>.
If the client variables are stored in the database, it's not so easy. Actually impossible, the cookie variables are NOT stored in the datasource.
First to locate the CLIENT variables, which are stored in a table called CDATA. CFGLOBALS client variables are session variables, like CFID, CFTOKEN and timestamp details and are stored in the table CGLOBAL.
So what about the error? The data types text and varchar are incompatible in the equal to operator.
I ran some queries to try and see if there was some information I could glean from the client variables table.
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
SELECT TOP 1000 [cfid]
,[app]
,[data]
FROM [hoton].[dbo].[cdata]
where [data] != ''
1SELECT TOP 1000 [cfid]
2 ,[app]
3 ,[data]
4 FROM [hoton].[dbo].[cdata]
5 where [data] != ''
Error: The data types text and varchar are incompatible in the not equal to operator.
[data] is a text field permitting nulls. So I checked for null:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
SELECT TOP 1000 [cfid]
,[app]
,[data]
FROM [hoton].[dbo].[cdata]
where [data] is null
1SELECT TOP 1000 [cfid]
2 ,[app]
3 ,[data]
4 FROM [hoton].[dbo].[cdata]
5 where [data] is null
pulled up everything, to test, I ran this:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
SELECT TOP 1000 [cfid]
,[app]
,[data]
FROM [hoton].[dbo].[cdata]
where [data] is not null
1SELECT TOP 1000 [cfid]
2 ,[app]
3 ,[data]
4 FROM [hoton].[dbo].[cdata]
5 where [data] is not null
which turned up nothing! So I added a space in the quotes:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
SELECT TOP 1000 [cfid]
,[app]
,[data]
FROM [hoton].[dbo].[cdata]
where [data] != ' '
1SELECT TOP 1000 [cfid]
2 ,[app]
3 ,[data]
4 FROM [hoton].[dbo].[cdata]
5 where [data] != ' '
The data types text and varchar are incompatible in the not equal to operator.
No go! But this worked:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
SELECT TOP 1000 [cfid]
,[app]
,[data]
FROM [hoton].[dbo].[cdata]
where [data] not like ''
1SELECT TOP 1000 [cfid]
2 ,[app]
3 ,[data]
4 FROM [hoton].[dbo].[cdata]
5 where [data] not like ''
which pulled up what I wanted to look at, but unfortunately could not use. No cookie info is stored in with the datasource client session storage option in the ColdFusion administrator.
There are no comments for this entry.
[Add Comment] [Subscribe to Comments]