select command denied for user for table hd_ticket
Why does this work, and the script below it not work and wind up with denied error? (select command denied for user XXXX for table hd_ticket). Doing this in mysql Workbench
SELECT
V3.FIELD_VALUE AS CUSTOM_3,
COALESCE(UL.NAME, 'Unassigned') AS LOCATION,
USER.LOCATION_ID,
USER.FULL_NAME
FROM
USER
LEFT JOIN
USER_FIELD_VALUE V3 ON V3.USER_ID = USER.ID AND V3.FIELD_ID = 3
LEFT JOIN
ASSET UL ON UL.ID = USER.LOCATION_ID
AND UL.ASSET_TYPE_ID = 1
WHERE
((V3.FIELD_VALUE LIKE '%charlotte%'))
NO WORKY:
SELECT org1.user_field_value.FIELD_VALUE AS CUSTOM_3,
COALESCE(UL.NAME, 'Unassigned') AS LOCATION,
USER.LOCATION_ID,
USER.FULL_NAME
FROM
USER
LEFT JOIN org1.user_field_value ON org1.user_field_value.USER_ID = USER.ID AND org1.user_field_value.FIELD_ID = 3
LEFT JOIN ASSET UL ON UL.ID = USER.LOCATION_ID AND UL.ASSET_TYPE_ID = 1
WHERE
((org1.user_field_value.FIELD_VALUE LIKE '%charlotte%'))
Answers (1)
Top Answer
Change ALL of the following to uppercase.
org1.user_field_value > ORG1.USER_FIELD_VALUE
Comments:
-
I feel incredibly stupid and angry and the same time. Seems archaic to be case sensitive. But I am not a "sql guy" so this is probably very basic. thank you for responding. This solved the same issue on another script which I fought for many frustrating hours on over the weekend.
I dont think I will ever type another sql command in lowecase again even though I have many within the kace SMA running fine.
Thanks again. - barchetta 3 years ago-
Since the DB and Table names are capitalized in MySQL, it's required you do the same. The column name can be lowercase. - KevinG 3 years ago