Action disabled: revisions


The DBQuery is inherited from the DBTable component and maintains a database table in your database. In this case, you must supply your own SQL instead of using a table name. If you need to use CRUD then you can apply a CRUD component to supply individual SQL statements for each action.

DBQuery is extremely useful for creating reporting grids based upon free queries.

Property Description Values
AutoSyncAutomatically synchronize result dataset after update
DBConnectionName of the predefined connection id's.Will be filled by default by all the connections available for your application. If there is only one, then this connection id is used by default.
FieldsThe fields of the table that will be used by the components referring to this component.It will open a property editor containing all fields of the table and allows to select/unselect the fields to be used. This is a mandatory step. If you do not open this property editor, no fields will be selected causing a generation error/warning.
MasterDataMappingMapping of key fields between master and detail
MasterDataSourceDatasource of the master table (only required on master-detail relationships)
QueryReference to a query setup. Opens the Query Builder to create your SQL in a visual way. Useful for complex queries, or if you require links (cloud connection) to another query in another application.
ResultCacheChanges the search result in an SQLite table. Needed for bidirectional access. SET TO FALSE if this table is used as detail. Because of the caching, accessing this table will reopen the last result causing wrong results if you are using it as detail. B.t.w. if you set a master data source this field is automatically set to false.True, false
ResultLimitCountNobody is scrolling hundreds of pages to find a result. This field limits the number of records found on a search for better performance.10000
ResultLimitOffsetStartpoint within a resultsetinteger
ResultlimitstmStatement for limiting resultset. Needed for compatibility. If not set, the system will use the settings at the database. Required due to the fact that there is no standard Ansii syntax for limiting result
ResultUseLimitIf set to false then the full resultset will be retrievedtrue, false
SQLSQL statement to execute. Use only if you haven't used the query property. Very useful in applying SQL statements in the code.If you use functions in your query then ALWAYS use 'as <mynewfieldname>'. PHsPeed uses the SQL parser of the database, which might report odd field names that are not compliant with PHP. By using 'as' you can assign a valid field name.
SQLCrudReference to a SQL Crud component (containing crud SQL statements)Dropdown with table names
Property Description Values
onAfterDeleteTriggers after the record is deleted
onAfterInsertTriggers after the record is inserted
onAfterOpenTriggers after the table is opened (select..)
onAfterUpdateTriggers after the record is updated
onBeforeDeleteTriggers before the record is deleted
onBeforeInsertTriggers before the record is inserted
onBeforeOpenTriggers before the table is opened
onBeforeUpdateTriggers before the record is updated

No additional events

  • dbquery.txt
  • Last modified: 2021/06/06 12:28
  • by aducomadmin