We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is my code :
this.trino.execute({ query: "EXECUTE query0 USING TIMESTAMP'2022-05-14 00:00:00',TIMESTAMP'2022-05-17 00:00:00'", prepares: ['select * from localdevmysql217.binglog.appointmentindex_202108 where between ? and ?'], state: function (error, query_id, stats) { console.log({ message: 'status changed', id: query_id, stats: stats }); }, columns: function (error, data) { console.log({ resultColumns: JSON.stringify(data) }); }, data: function (error, data, columns, stats) { console.log('data: ', data); }, success: function (error, stats) { console.log(stats); }, error: function (error) { console.log(error); }, });
This is the return result:
{ message: 'Prepared statement not found: query0', errorCode: 5, errorName: 'NOT_FOUND', errorType: 'USER_ERROR', failureInfo: { type: 'io.trino.spi.TrinoException', message: 'Prepared statement not found: query0', suppressed: [], stack: [ 'io.trino.util.Failures.checkCondition(Failures.java:64)', 'io.trino.Session.getPreparedStatement(Session.java:277)', 'io.trino.Session.getPreparedStatementFromExecute(Session.java:271)', 'io.trino.execution.QueryPreparer.prepareQuery(QueryPreparer.java:65)', 'io.trino.execution.QueryPreparer.prepareQuery(QueryPreparer.java:56)', 'io.trino.dispatcher.DispatchManager.createQueryInternal(DispatchManager.java:180)', 'io.trino.dispatcher.DispatchManager.lambda$createQuery$0(DispatchManager.java:149)', 'io.trino.$gen.Trino_375____20220520_013819_2.run(Unknown Source)', 'java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)', 'java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)', 'java.base/java.lang.Thread.run(Thread.java:829)' ] } }
The text was updated successfully, but these errors were encountered:
@SitdownLiu did you ever figure out a solution here? Also having issues getting a response back when using a prepared statement
Edit: my issue was passing PREPARE ... ${query} to prepares rather than just ${query}.
PREPARE ... ${query}
prepares
${query}
Sorry, something went wrong.
No branches or pull requests
Has anyone encountered a similar problem?
This is my code :
This is the return result:
The text was updated successfully, but these errors were encountered: