cfdocs

queryInsertAt

Inserts an element into a query at the indicate position. Elements with equal or greater positions are incremented by one. Returns the updated query with the element inserted.

queryInsertAt(query,value,position)
returns query

Member Function Syntax

query.InsertAt(value,position)

Argument Reference

Name Type Required Default Description
query query Yes   The original query object.
value query Yes   The query object to insert.
position numeric Yes   Index position at which to insert the query object.

Example1

This is Example1

qry=queryNew("rowid,name", "integer,varchar",[ [1, "Jay"],[2, "Bob"],[3, "Theodore"],[4, "William"] ]);
rufus=QueryNew("rowid,name","integer,varchar",[[42,"Rufus"]]);
queryInsertAt(qry,rufus,3);
WriteDump(qry);

Member function version.

Using the member function.

qry=queryNew("rowid,name", "integer,varchar",[ [1, "Jay"],[2, "Bob"],[3, "Theodore"],[4, "William"] ]);
rufus=QueryNew("rowid,name","integer,varchar",[[42,"Rufus"]]);
qry.InsertAt(rufus,3);
WriteDump(qry);