I am trying to retrieve data from an Oracle 10g database into a simple Visual Studio project. The sql statement (see below) is very simple and works fine when I run it in SQL Server Management Studio; however, when I try to execute the statement in Visual Studio I get the following error:
ERROR [HY000] [Oracle][ODBC][Ora]ORA-00933: SQL command not properly ended
As I said, this same command executes with no errors in SQL Server Management Studio.
when UserName = '2085' then 'Hazel'
when UserName = '2088' then 'Tracie'
mbrsep, name, transdate, cafield, oldval, newval
from openquery(SEDCCA, '
select anntrandetl.mbrsep, name, transdate, cafield, oldval, newval, oper as UserName
from anntrandetl inner join mbrsepmstr on anntrandetl.mbrsep = mbrsepmstr.mbrsep
where transdate >= '090719' and cafield = 'MAILCODE' AND (UserName = '2085' or UserName = '2088')