Create, execute and delete prepared statements in cbq

In Couchbase’s console interface cbq, how do I create, execute and delete prepared statements? In the documentation, there’s only instruction for the REST api.


Found another place in the doc where it says cbq is not supported.

Hi cbq does not allow prepared statement execution fully today. We will be previewing the next version of cbq tool that will provide better support for these facilities.
Here is a quick sample you can use to see prepared executions;

  • First call prepares a statement.

prepare sample_query from select * fromtravel-sampleuse keys "airline_10";

  • Second call loops through an execution of the named prepared statement using prepared=“sample_query”

Full script below:

curl -v 
for i in `seq 1 100`; do
             curl -v http://localhost:8093/query/service?prepared=%22sample_query%22

@cihangirb Thank you! I ended up using the java sdk to execute the prepared statement.

Have already replied in another thread, but, for completeness, in Watson you will be able to do the whole prepare statement / execute prepare statement / delete prepared statement straight from cbq.