我怀疑您遇到了查询显示名称而不是列名称的问题,请通过 ServiceNow ODBC 驱动程序和工具测试您的查询以进行调试。http://wiki.servicenow.com/index.php?title=Using_Interactive_SQL_With_ODBC
我怀疑您的查询将返回一个错误,因为这可能是一个显示名称。例如,如果您查询[Assignment group]而不是assignment_group,您将收到错误消息。
select number, short_description, [Assignment group] from incident where number = 'INC0012345';
结果
The following error information describes the failure
ODBC Call = SQLPrepareW()
SQL State = 42S22
Native error = 10125(278D)
Error Message = [SN][ODBC ServiceNow driver][OpenAccess SDK SQL Engine]Column:Assignment group not found.
切换到列名将起作用
select number, short_description, assignment_group from incident where number = 'INC0012345';
结果
NUMBER short_description assignment_group
INC0012345 My incident short descrtiption 123b1c123f12f1234567e123b1234abc