Use the Editable SQL TextBox (SqlTextBox) control to display the result of an SQL query, for example, showing the area which is stored in a different table. It is recommended that you use this type of control only when you query a single attribute.
If you do not want to edit the value and just show it, it is recommended that you use the Read-Only SQL TextBox control, which has a better performance.
Property |
Description |
System Category |
|
ClassName |
SqlTextBox |
Name |
Specifies the name. For example, $SQLTEXTBOX1. |
Base |
|
IsLocked |
If True, the value cannot be edited. |
Specific Category |
|
AlignRight |
If True, aligns the value. Specifies whether the value is aligned to the right edge of the input box. |
AllowMultiRowUpdate |
If False, checks whether the update tries to update more than one row in the linked table. If so, the whole update is ignored, and a message will appear. Otherwise with a wrong SQL statement, you could destroy your data when your SQL would create unwanted updates. |
DetailAttributeName |
Specifies the attribute (to be selected from the detail table) that you want to display. |
DetailFilter |
The filter expression for the select statement (without a WHERE expression). Click to open the SQL Assistant. Use the SQL Assistant to build the filter statement. However, you must cut off the first part, including the WHERE. |
DetailTable |
Specifies the table from which you want to select data. |
Note the difference between Read-Only SQL TextBox and Editable SQL TextBox. Both controls allow you to query data, but the Read-Only SQL TextBox results in a read-only label, that cannot be edited. The Editable SQL TextBox results in a text box, where the value can be edited and saved (updated) in the database.
For this reason, the SQL statements differ in the way they are defined. While the Read-Only SQL label statement can be defined as one expression in the SQL property, the Editable SQL text box statement consists of three components (DetailAttributeName, DetailFilter and DetailTable properties). However, both statements have the same result.
Because of the splitting, the system is able to update the record. When the user saves the record, the system updates the related detail table, using the following command:
Update <detailtable name> set <detailfield name> ='<your input>' where <detail filter>.