SQL Query Examples
The SQL Query result sets can be either generic (multiple rows, multiple columns), vertical (multiple rows, 1 column) or horizontal (1 row, multiple columns).
Generic example
Assuming the following binding properties set for the SQL query:
The data binding set should match the query result set so in this case, we'll have the following result set:
COL_A | COL_B | COL_C | |
---|---|---|---|
ROW_1 | VAL_1A | VAL_1B | VAL_1C |
ROW_2 | VAL_2A | VAL_2B | VAL_2C |
ROW_3 | VAL_3A | VAL_3B | VAL_3C |
Results
- any ListBox or ComboBox controls that have the associated property named COL_A_PROP will be populated with VAL_1A, VAL_2A, VAL_3A.
- any ListBox or ComboBox controls that have the associated property named COL_B_PROP will be populated with VAL_1B, VAL_2B, VAL_3B.
- any ListBox or ComboBox controls that have the associated property named COL_C_PROP will be populated with VAL_1C, VAL_2C, VAL_3C.
- properties COL_A_PROP, COL_B_PROP and COL_C_PROP will be directly set to VAL_1A, VAL_1B and respectively VAL_1C (first result set row).
Before deploying the new result set, the previous binding content will be cleared.
Vertical example
COL_A | |
---|---|
ROW_1 | VAL_1A |
ROW_2 | VAL_2A |
ROW_3 | VAL_3A |
Results
- any ListBox or ComboBox that have the associated property named COL_A_PROP will be populated with VAL_1A, VAL_2A, VAL_3A.
Horizontal example
COL_A | COL_B | COL_C | |
---|---|---|---|
ROW_1 | VAL_1A | VAL_1B | VAL_1C |
Results
- properties COL_A_PROP, COL_B_PROP and COL_C_PROP will be directly set to VAL_1A, VAL_1B and respectively VAL_1C (first result set row).
An empty result set is a valid output.