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:

Data Binding

The data binding set should match the query result set so in this case, we'll have the following result set:

COL_ACOL_BCOL_C
ROW_1VAL_1AVAL_1BVAL_1C
ROW_2VAL_2AVAL_2BVAL_2C
ROW_3VAL_3AVAL_3BVAL_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).

NoteBefore deploying the new result set, the previous binding content will be cleared.

Vertical example

COL_A
ROW_1VAL_1A
ROW_2VAL_2A
ROW_3VAL_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_ACOL_BCOL_C
ROW_1VAL_1AVAL_1BVAL_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).

ImportantAn empty result set is a valid output.