Deletes a row within a query object.
queryDeleteRow(query [, row])
returns boolean
query.deleteRow([row])
Name | Type | Required | Default | Description |
---|---|---|---|---|
query | query | Yes | Query to modify | |
row | numeric | No | -9999 | Index of the row to delete, starts at 1. If a row is not specified, the last row is removed. |
Builds a simple query and removes the last row by not specifying a row index.
news = queryNew("id,title", "integer,varchar", [ {"id":1,"title":"Dewey defeats Truman"}, {"id":2,"title":"Man walks on Moon"} ]);
queryDeleteRow(news);
writeOutput(news['title'][1]);
Builds a simple query and removes one of the rows.
news = queryNew("id,title", "integer,varchar", [ {"id":1,"title":"Dewey defeats Truman"}, {"id":2,"title":"Man walks on Moon"} ]);
queryDeleteRow(news, 1);
writeOutput(news['title'][1]);