Q:

Syntax Error, Operator Expected

I am trying to query the MS SQL Server database using Prolog.
Prolog Code
lemmas:-
        odbc_query('my_db',
                   'SELECT * ,case 
                   when ActualCost<EstimatedCost then 'true'
                   else 'false' 
                   end as Value
                   from Work_Order '
                   ).

It gives an error that operator is expected after 'true' .
Note: The Query works in SQL-Server but it doesn't work in Prolog

A:

Try:
lemmas:-
        odbc_query('my_db',
                   'SELECT * ,case                             \
                   when ActualCost<EstimatedCost then \'true\' \
                   else \'false\'                              \   
                   end as Value                                \
                   from Work_Order '
                   ).

In this manner, a lot of extra spaces are transmitted.  However, practically all programming languages are not (very) sensitive to adding extra spaces at the end of a line. This is still our heritage from punched cards. You only need to know that in those days space was represented by no punched hole at all. So a fresh card was pre-filled with 80 spaces.

