Inserts an element into a query at the indicate position. Elements with equal or greater positions are incremented by one. Returns the updated query with the element inserted.
queryInsertAt(query,value,position)
returns query
query.InsertAt(value,position)
Name | Type | Required | Default | Description |
---|---|---|---|---|
query | query | Yes | The original query object. | |
value | query | Yes | The query object to insert. | |
position | numeric | Yes | Index position at which to insert the query object. |
This is Example1
qry=queryNew("rowid,name", "integer,varchar",[ [1, "Jay"],[2, "Bob"],[3, "Theodore"],[4, "William"] ]);
rufus=QueryNew("rowid,name","integer,varchar",[[42,"Rufus"]]);
queryInsertAt(qry,rufus,3);
WriteDump(qry);
Using the member function.
qry=queryNew("rowid,name", "integer,varchar",[ [1, "Jay"],[2, "Bob"],[3, "Theodore"],[4, "William"] ]);
rufus=QueryNew("rowid,name","integer,varchar",[[42,"Rufus"]]);
qry.InsertAt(rufus,3);
WriteDump(qry);