In a query object, swap the record in the sourceRow with the record from the destinationRow.
queryRowSwap(query, sourceRow, destinationRow )
returns query
query.rowSwap(sourceRow, destinationRow)
Name | Type | Required | Default | Description |
---|---|---|---|---|
query | query | Yes | The original query object. | |
sourceRow | numeric | Yes | The row to swap. | |
destinationRow | numeric | Yes | The row to be swapped with. |
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);