QuerySetRow()

Adds a row to a query, either by struct or array

Introduced: 5.3.8.120

QuerySetRow( query=query, rowNumber=number, rowData=any );

Returns: Boolean

Argument Description Default
query
query, required

query object to set row

rowNumber
number, optional

position of the row to updated, otherwise a new row is added

Alias: row

0

rowData
any, required

a struct or array

Alias: data

Examples

testQuery=queryNew("id,name", "integer,varchar",
        [
            {"id"=1,"name"="jenifer"},
            {"id"=2,"name"="ajay"},
            {"id"=3,"name"="john"},
            {"id"=4,"name"="smith"}
        ]);
<span class="nf">querySetRow</span><span class="p">(</span><span class="nv">testQuery</span><span class="p">,</span> <span class="m">3</span><span class="p">,</span> <span class="p">{</span><span class="s2">&quot;id&quot;</span><span class="o">=</span><span class="m">5</span><span class="p">,</span><span class="s2">&quot;name&quot;</span><span class="o">=</span><span class="s2">&quot;alpha&quot;</span><span class="p">});</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="nv">testQuery</span><span class="p">);</span>

See also