query.insertAt()

Adds data (query,struct or array) into query.

Introduced: 6.0.0.16

query.insertAt( value=any, index=numeric )

Returns: Query

Argument Description
value
any, required

data to insert, can be a query, a struct or an array.

index
numeric, required

position to insert data into, existing data get moved to the "right".

Examples

qry1 = queryNew( "name, age", "varchar, integer",
        [
            [ "Susi", 20 ],
            [ "Urs", 24 ],
            [ "Smith", 21 ],
            [ "John", 26 ]
        ]);
    qry2 = queryNew( "name, age", "varchar, integer",
        [
            [ "Jeni", 19 ]
        ]);
    writeOutput("Before QueryInsert :");    
    writeDump(qry1);
<span class="nf">qry1.insertAt</span><span class="p">(</span> <span class="nv">qry2</span><span class="p">,</span> <span class="m">3</span> <span class="p">);</span>
<span class="nf">writeOutput</span><span class="p">(</span><span class="s2">&quot;After QueryInsert :&quot;</span><span class="p">);</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="nv">qry1</span><span class="p">);</span>

See also