G
Guest
Hi Everybody,
I've got a dotnet application (1.1) that works with a foxpro dbase (using
the oledb provider for FoxPro 8.0).
Most of the code works, But I've run across a strange problem:
When I run the following sql statement:
SELECT fldscorpio.id AS POINT_ID, fu_id, fldunit.name as fu_name,
fldscorpio.name, fldscorpio.description,slavetype, fldscorpio.dc_status
+IIF(fldscorpio.ac_fail,524288,000000)+fldscorpio.comm_fail*15 as status,
0 as channel,0 as slot, fldscorpio.address as address, fldscorpio.piu as
piu, 0 as base_type,
(fldscorpio.dc_status
+IIF(fldscorpio.ac_fail,256,000)+fldscorpio.comm_fail)>0 as FAULT
FROM fldscorpio
INNER JOIN fldunit ON fldunit.id=fldscorpio.fu_id
LEFT OUTER JOIN userarea ON userarea.area=fldunit.area
WHERE (((? IS NULL) OR (slavetype=?))) AND (((? IS NULL) OR (FAULT=?)))
UNION
SELECT fldpoint.POINT_ID as POINT_ID, fldpoint.fu_id, fldunit.name as
fu_name, fldpoint.name, fldpoint.desc as description,0 as slavetype,
fldpoint.status as status,
fldpoint.channel as channel,fldpoint.slot as slot, fldpoint.rack as address,
0 as piu,
fldpoint.base_type as base_type,
fldpoint.status >0 as FAULT
from fldpoint
INNER JOIN fldunit ON fldpoint.fu_id=fldunit.id
LEFT OUTER JOIN userarea ON userarea.area=fldunit.area
where (((? IS NULL) OR (slavetype=?))) AND (((? IS NULL) OR (FAULT=?))) AND
fldpoint.slot >0 and not(exists(select id from fldscorpio where
fldpoint.slot=fldscorpio.id))
I get an error:
System.Data.OleDb.OleDbException: SQL: Column 'FAULT' is not found.
In the sql , in both statements I've got a calculated column called 'FAULT',
so why does it complain that it can't find column 'FAULT'?
Nadav
I've got a dotnet application (1.1) that works with a foxpro dbase (using
the oledb provider for FoxPro 8.0).
Most of the code works, But I've run across a strange problem:
When I run the following sql statement:
SELECT fldscorpio.id AS POINT_ID, fu_id, fldunit.name as fu_name,
fldscorpio.name, fldscorpio.description,slavetype, fldscorpio.dc_status
+IIF(fldscorpio.ac_fail,524288,000000)+fldscorpio.comm_fail*15 as status,
0 as channel,0 as slot, fldscorpio.address as address, fldscorpio.piu as
piu, 0 as base_type,
(fldscorpio.dc_status
+IIF(fldscorpio.ac_fail,256,000)+fldscorpio.comm_fail)>0 as FAULT
FROM fldscorpio
INNER JOIN fldunit ON fldunit.id=fldscorpio.fu_id
LEFT OUTER JOIN userarea ON userarea.area=fldunit.area
WHERE (((? IS NULL) OR (slavetype=?))) AND (((? IS NULL) OR (FAULT=?)))
UNION
SELECT fldpoint.POINT_ID as POINT_ID, fldpoint.fu_id, fldunit.name as
fu_name, fldpoint.name, fldpoint.desc as description,0 as slavetype,
fldpoint.status as status,
fldpoint.channel as channel,fldpoint.slot as slot, fldpoint.rack as address,
0 as piu,
fldpoint.base_type as base_type,
fldpoint.status >0 as FAULT
from fldpoint
INNER JOIN fldunit ON fldpoint.fu_id=fldunit.id
LEFT OUTER JOIN userarea ON userarea.area=fldunit.area
where (((? IS NULL) OR (slavetype=?))) AND (((? IS NULL) OR (FAULT=?))) AND
fldpoint.slot >0 and not(exists(select id from fldscorpio where
fldpoint.slot=fldscorpio.id))
I get an error:
System.Data.OleDb.OleDbException: SQL: Column 'FAULT' is not found.
In the sql , in both statements I've got a calculated column called 'FAULT',
so why does it complain that it can't find column 'FAULT'?
Nadav