QueryInsertAt

Inserts a query data into another query at a specific position

Method Signature

QueryInsertAt(query=[query], value=[query], position=[numeric])

Arguments

Argument
Type
Required
Description
Default

query

query

true

The source query to insert to

value

query

true

The query that will be inserted

position

numeric

true

The position where the query will be inserted

Examples

Example1

This is Example1

Run Example

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 );

Member function version.

Using the member function.

Run Example

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 );

Additional Examples

Run Example

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 );
QueryInsertAt( qry1, qry2, 3 );
writeOutput( "After QueryInsert :" );
writeDump( qry1 );

Last updated

Was this helpful?