/build/static/layout/Breadcrumb_cap_w.png

SQL error in the kace SMA that works fine in mysql workbench.


Hi there guys.

Could you consider the code below. It is a nipped of a larger code where i would have to substitute values in a lot of places. Thus chose to use a variable.

This code works fine in mysql workbench with an odbc connection to the SMA.

But in the kace SQL report it gives me an error ...........     [mysqli error: [1064: You have an error in your SQL syntax; check.............]

Does the Kace sma not know about setting variables? And is there any way to make this work on the SMA. 

See example code....


SET @user_id = 10992;

SELECT CONCAT('JBN USER TALLY:', V2.FIELD_VALUE) AS DEVICE, "" as ASSIGNED_TO, ""

FROM USER

LEFT JOIN USER_FIELD_VALUE V2 ON V2.USER_ID = USER.ID AND V2.FIELD_ID = 2

WHERE USER.ID = @user_id


0 Comments   [ + ] Show comments

Answers (0)

Be the first to answer this question

Don't be a Stranger!

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

Sign up! or login

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