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

query query
Required

The original query object.

value query
Required

The query object to insert.

position numeric
Required

Index position at which to insert the query object.

Compatibility

ColdFusion:

Version 2018+ Added in CF2018 Update 5

Lucee:

Version 6+ Added in Lucee 6.0.0.16

Examples
Sample code invoking the queryInsertAt function

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);

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);

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub