I need a workaround for a problem in Abator with Microsoft Sql Server.

  Abator generates the following SQL statment which gives an error (the problem
is that "FUNCTION" is a keyword):

    select BUDGET_UNIT, FUNCTION, FUNCTION_NAME from b0maschm.MAT_ORGSTRUCTURE

    The error it gives is: 

--- The error occurred while applying a parameter map.  
--- Check the
b0maschm_MAT_ORGSTRUCTURE.abatorgenerated_selectByExample-InlineParameterMap.  
--- Check the statement (query failed).  
--- Cause: java.sql.SQLException: [IBM][SQLServer JDBC
Driver][SQLServer]Incorrect syntax near the keyword 'FUNCTION'.
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   


     As a workaround I can fix the error so that Abator works fine by going
into the Abator generated file "b0maschm_MAT_ORGSTRUCTURE_SqlMap.xml" and
changing the select to the following (notice the brackets around "function"): 

    select BUDGET_UNIT, [FUNCTION], FUNCTION_NAME, from
0maschm.MAT_ORGSTRUCTURE


    Please advise if possible how to change the XML to stop this error. I tried
the following but it had no effect on the SQl and the same error occured:

    <table schema="b0maschm" tableName="MAT_ORGSTRUCTURE" 
           enableInsert="false" enableUpdateByPrimaryKey="false"
           enableDeleteByPrimaryKey="false" enableDeleteByExample="false">
        <columnOverride column="function" property="functionCode"/>           
    </table> 

Reply via email to