Question
· Feb 9, 2018

SQL prepare error

I'm trying to learn how To use SQL in CACHE, so I hope I don't bore you with "Dumb" questions.... 

I'm getting "ERROR #6022: Gateway failed" message following this line of code. 

s sc=gc.Prepare(hstmt,pQuery) 

This line of code comes from an example I found in the documentation.  pQuery is the "Select" statement setting up the variables and tables I'm trying to pull information from. 

What does that error indicate? 

Thank you. 

Discussion (5)0
Log in or sign up to continue

For reference, you can get a list of error codes from General Error Codes and SQL Error Codes .  From the error description, it seems to be complaining about the 1st parameter.

If the 'gc' object is a %SQL.Statement then the %Prepare method only takes one parameter. What happens when you pass in pQuery to the %Prepare method?

Have you tried executing the SQL in the SQL Shell or System Management Portal?

do $System.SQL.Shell()