QueryNew()

Creates an empty query (query object).

QueryNew( columnNames=object, columnTypes=object, data=any );

Returns: Query

Argument Description
columnNames
object, required

column names for the query created, allowed are comma-delimited string lists or an array.

Alias: names, columns, columnList

columnTypes
object, optional

column types for the query created, allowed are comma-delimited string lists or an array.

Alias: types, columnTypeList

data
any, optional

data to populate the new Query, an array of arrays or an array of structs.

Example usage:

  • queryNew( "name,age", "varchar,numeric", [ [ "Susi", 20 ],[ "Urs", 24 ] ] );
  • queryNew( "name,age", "varchar,numeric", [ [ name:"Susi", age:20 ], [ name:"Urs", age:24 ] ] );
  • queryNew( "name,age", "varchar,numeric", { name:[ "Susi", "Urs" ], age:[ 20, 24 ] } );

Examples

testQuery = queryNew( "name , age" , "varchar , numeric" , { name: [ "Susi" , "Urs" ] , age: [ 20 , 24 ] } );
 	dump(testQuery); 
<span class="nv">qry</span><span class="o">=</span> <span class="nf">queryNew</span><span class="p">(</span> <span class="s2">&quot;name , age&quot;</span> <span class="p">,</span> <span class="s2">&quot;varchar , numeric&quot;</span> <span class="p">,</span> <span class="p">[</span> <span class="p">[</span> <span class="s2">&quot;Susi&quot;</span> <span class="p">,</span> <span class="m">20</span> <span class="p">]</span> <span class="p">,</span> <span class="p">[</span> <span class="s2">&quot;Urs&quot;</span><span class="p">,</span> <span class="m">24</span> <span class="p">]</span> <span class="p">]);</span>
<span class="nf">dump</span><span class="p">(</span><span class="nv">qry</span><span class="p">);</span>
<span class="nv">qry</span><span class="o">=</span> <span class="nf">queryNew</span><span class="p">(</span> <span class="s2">&quot;name , age&quot;</span> <span class="p">,</span> <span class="s2">&quot;varchar , numeric&quot;</span> <span class="p">,</span> <span class="p">[</span> <span class="p">{</span> <span class="nv">name</span><span class="p">:</span> <span class="s2">&quot;Susi&quot;</span> <span class="p">,</span> <span class="nv">age</span><span class="p">:</span> <span class="m">20</span> <span class="p">},</span> <span class="p">{</span> <span class="nv">name</span><span class="p">:</span> <span class="s2">&quot;Urs&quot;</span> <span class="p">,</span> <span class="nv">age</span><span class="p">:</span> <span class="m">24</span> <span class="p">}</span> <span class="p">]</span> <span class="p">);</span>
<span class="nf">dump</span><span class="p">(</span><span class="nv">qry</span><span class="p">);</span>

See also