/build/static/layout/Breadcrumb_cap_w.png

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%'))


0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
Posted by: KevinG 2 years ago
Red Belt
0

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 2 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 2 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ