我有一个在MSSQL中工作正常但在MYSQL中出现#1064错误的查询。请帮我识别错误?提前致谢
UPDATE setup_business_rule
SET
BR_NAME='SEND_EMAIL_AFTER_TICKET_OPEN edit',
BR_DESC='Send notification email when new ticket was created.',
BR_CATEGORY='Desktop',
STATUS='False',
SMS='False',
EMAIL='True',
CONDITION=' [TICKETSTATUS] [=] [STATUSOPEN]',
OCCURS_CREATE='True',
OCCURS_UPDATE='True',
TARGET_SMS='',
ACTION_ON='Notification',
TARGET_EMAIL=' [techsupport@macrokiosk.com] [Contact Email]',
TARGET_MESSAGE='message',
ESCALATION_TYPE='0000000',
ESCALATION_TABLE='',
ESCALATION_COLUMN='',
ESCALATION_VALUE='',
OCCURS_FORM='HD',
OCCURS_FIELD='0000000',
TARGET_SUBJECT='[TICKETDESCRIPTION] (CID:[TICKETNO])' ,
ACTION_GROUP_ID = '0000000',
IS_WORKING_HOUR = 0,
IS_BASED_DURATION = 0,
MINUTES_DURATION = ''
WHERE BR_ID='000001'
AND SEG_ID ='0001'
答案 0 :(得分:2)
我看到的唯一问题是在condition
是保留字的下面一行,应该使用backtique进行转义
`CONDITION` =' [TICKETSTATUS] [=] [STATUSOPEN]'
所以你的整个UPDATE
语句看起来应该是
UPDATE setup_business_rule
SET
BR_NAME='SEND_EMAIL_AFTER_TICKET_OPEN edit',
BR_DESC='Send notification email when new ticket was created.',
BR_CATEGORY='Desktop',
STATUS='False',
SMS='False',
EMAIL='True',
`CONDITION`=' [TICKETSTATUS] [=] [STATUSOPEN]', <-- Here
OCCURS_CREATE='True',
OCCURS_UPDATE='True',
TARGET_SMS='',
ACTION_ON='Notification',
TARGET_EMAIL=' [techsupport@macrokiosk.com] [Contact Email]',
TARGET_MESSAGE='message',
ESCALATION_TYPE='0000000',
ESCALATION_TABLE='',
ESCALATION_COLUMN='',
ESCALATION_VALUE='',
OCCURS_FORM='HD',
OCCURS_FIELD='0000000',
TARGET_SUBJECT='[TICKETDESCRIPTION] (CID:[TICKETNO])' ,
ACTION_GROUP_ID = '0000000',
IS_WORKING_HOUR = 0,
IS_BASED_DURATION = 0,
MINUTES_DURATION = ''
WHERE BR_ID='000001'
AND SEG_ID ='0001'