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 and up.  Not supported on Lucee, etc.

queryRowSwap 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.

Compatibility

ColdFusion:

Version 2018+ Added in CF2018 Update 5

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

Fork me on GitHub