queryDeleteRow

Deletes a row within a query object.

queryDeleteRow(query [, row]) → returns boolean

Member Function Syntax

query.deleteRow([row])

queryDeleteRow Argument Reference

query query
Required

Query to modify

row numeric
Default: -9999

Index of the row to delete, starts at 1. If a row is not specified, the last row is removed.

Examples sample code invoking the queryDeleteRow function

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

Expected Result: Dewey defeats Truman

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

Expected Result: Man walks on Moon


Fork me on GitHub