QueryAddColumn

Adds a column to a query and populates its rows with the contents of an one-dimensional array.

Pads query columns, if necessary, to ensure that all columns have the same number of rows.

QueryAddColumn( query, column [, datatype_or_array [, array ] ] )

Returns: Number

Argument Description
query
query, required

Name of a query object.

column
string, required

Alias: columnname

datatype_or_array
any, optional

Alias: datatype

array
any, optional

Examples

qry=queryNew("aaa,bbb");
QueryAddRow(qry);
	QuerySetCell(qry,"aaa","1.1");
	QuerySetCell(qry,"bbb","1.2");
QueryAddRow(qry);
	QuerySetCell(qry,"aaa","2.1");
	QuerySetCell(qry,"bbb","2.2");
QueryAddColumn(qry,"ccc",listToArray("3.1,3.2"));
QueryAddColumn(qry,"ddd","integer",listToArray("4.1,4.2"));
writeDump(qry.columnList);

See also