How to add dynamic value to the Insert Select query

Hi I have insert select query. I want to add dynamic values to it. Please see the below query.

N1qlQueryResult result = getCustomerBucket().query(N1qlQuery.simple(
“INSERT INTO couchbaseDb (key _k, value _v) SELECT META().id || “1” AS _k, t AS _v FROM couchbaseDb t WHERE META().id=“abc”;”));

But I want to replace “1” to dynamic value x in for loop like below.

for (int x=1;x<=5;x++){
N1qlQueryResult result = getCustomerBucket().query(N1qlQuery.simple(
“INSERT INTO couchbaseDb (key _k, value _v) SELECT META().id || $x AS _k, t AS _v FROM couchbaseDb t WHERE META().id=“abc”;”));
}

Any one please help me on this.

Thanks!

You will want to look at the documentation on prepared statements/placeholders.