This Genero BDL demo implements a generic SQL query dialog that converts search criteria entered by the user, into a FROM and WHERE part to be used in a SELECT statement.
Callers can configure the query dialog with DB table and column description, providing the database object names, the SQL types and a display label.
- Latest Genero version
- GNU Make
- make clean all
- Load the query_dialog.4pw project
- Build the project
- Start the program
- Click on Query action to open the query dialog
- Enter search criterion
- Try the preview to see if the SQL runs
- Validate to run the SELECT statement in the caller
- fglquerydlg_init() : Initializes the library module
- fglquerydlg_fini() : Terminates the library module
- fglquerydlg_new(name) : Creates a new query set
- fglquerydlg_free(qx) : Frees the query set x
- fglquerydlg_set_select_list(qx, sl) : Defines the SELECT list for preview
- fglquerydlg_add_table(qx, tn, dn) : Add a DB table, returns the table id
- fglquerydlg_add_column(qx, tx, cn, ct, it, lx, dn) : Add a DB column for a table, returns the table id
- fglquerydlg_set_relation(qx, tx, rtn, sql) : Add a foreign key relation for a table.
- fglquerydlg_add_pick_list(qx, nm) : Creates a pick list
- fglquerydlg_add_pick_list_item(qx, lx, vk, vl) : Add an element to a pick list
- fglquerydlg_execute(qx,new) : Open the query dialog and wait for user input
- fglquerydlg_set_date_format(fmt) : Define the DATE format for date literals
- fglquerydlg_get_from_part(qx) : Returns the FROM part
- fglquerydlg_get_where_part(qx) : Returns the WHERE part
