MySQL Query Works in Browser but not in Script

Why would my named query fail to run in a script if it works in the query browser?

I have a named query with one parameter. When I copy/paste the query into the query browser and replace the parameter with a number it runs and returns the results I expect. However, when I use the system.db.runNamedQuery() method in the script console I get a “You have an error in your SQL syntax” error message.

We aren’t mind readers. Show us.

2 Likes

Show us the authoring tab of your named query, too.

And there it is…

The extra colon. Parameters are “:parameter” not “:parameter:”

2 Likes

:+1:

The socratic method does it again!

6 Likes

Psst! As soon as you saw gold users, you should have advised that no help can be offered on the forum for Integrator tests.

1 Like

Shoot! Missed that.

I only asked because I thought I had found a bug.

You are only allowed to ask the IA testing group. The forum is forbidden for anything related to certification.

1 Like