queryRowSwap

In a query object, swap the record in the sourceRow with the record from the destinationRow.

queryRowSwap(query, sourceRow, destinationRow ) → returns query

Member Function Syntax

query.rowSwap(sourceRow, destinationRow)

This function requires Adobe ColdFusion 2018.0.5 and up.  Not supported on Lucee, etc.

Argument Reference

query query
Required

The original query object.

sourceRow numeric
Required

The row to swap.

destinationRow numeric
Required

The row to be swapped with.

Examples
Sample code invoking the queryRowSwap function

This is Example1

qry=queryNew("rowid,name", "integer,varchar",[ [1, "Bob"],[2, "Theodore"],[3, "Jay"],[4, "William"] ]);
swap1=queryRowSwap(qry,1,4);
writeDump(swap1);

Using the member function.

qry=queryNew("rowid,name", "integer,varchar",[ [1, "Bob"],[2, "Theodore"],[3, "Jay"],[4, "William"] ]);
swap2=qry.rowSwap(1,4);
writeDump(swap2);

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

Fork me on GitHub