Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > SQLQuery class > Methods

SQLQuery class: replaceWhere

Scroll Prev Next More

 

Replaces the WHERE clause of the original SQL query with a new one.

 

Note: SQLQuery class methods are used in the After table initialized event.

Syntax

replaceWhere( condition )

Arguments

condition

any conditional clause. Example: "id_sizes < 3 or id_sizes > 6". id_sizes is the field name.

Return value

No return value.

Example 1

Display records from the table where the value of the test field is 'passed':

 

query.replaceWhere( "test = 'passed'" );

Example 2

Display records from where the value of the size field is 3 and the value of the adjust field is less than 2:

 

query.replaceWhere( "size = 3 and adjust < 2" );

Example 3

Display all table records:

 

query.replaceWhere( "" );

See also:

SQLQuery class: addWhere

Event: AfterTableInit

Security: Additional WHERE tabs

About SQLQuery class