![]() |
DB/Mask Interface |
|
The definition of the database access enables the assignment of variables to a certain table field of the database (and hence to the corresponding field in a DataView mask). Based on this approach, LogiView provides suitable functions and commands to select and modify the database contents. Commands and functions which can be executed separatelyAll these functions and commands represent an independent unit: |
abort_transaction | abort_transaction() This command is used to abort a database transaction started by means of 'start_transaction()'. All changes of the database are undone. |
db_function | {INT_VAR}= db_function ({STR_EXPR}, {VAR}, {EXPR_LIST}) This function executes the specified database function. A database function is a user-defined database-specific application function which could be compared with a "stored procedure". |
db_procedure | {INT_VAR}= db_procedure ({STR_EXPR}) or {INT_VAR}= db_procedure ({STR_EXPR},{EXPR_LIST}) This function executes the specified "stored procedure". A "stored procedure" is a user-defined database-specific procedure. |
end_transaction | end_transaction() This command ends a database transaction started by means of 'start_transaction'. All changes are accepted. |
start_transaction |
start_transaction()
|
sel_date | {DAT_VAR}= sel_date({STR_EXPR},{WHERE|actual})
or {DAT_VAR}= sel_date(act_fld) This function is used to select a database value. The corresponding database field must be the type "Date". |
sel_logic | {LOG_VAR}= sel_logic({STR_EXPR},{WHERE|actual})
or {LOG_VAR}= sel_logic(act_fld) This function reads a value from the database. The corresponding database field must be the type "Logic". |
sel_string | {STR_VAR}= sel_string({STR_EXPR},{WHERE|actual})
or {STR_VAR}= sel_string(act_fld) This function reads a value from the database. The corresponding database field must be the type "String". |
sel_value | {INT_VAR|FLO_VAR}= sel_value({FLD},{WHERE|actual}), {INT_VAR|FLO_VAR}= sel_value({DBF}({FLD}),{WHERE}) or {INT_VAR|FLO_VAR}= sel_value(act_fld) This functions reads a value from the database. |
upd_var | upd_var({VAR}) Using this field, an 'Update' is executed for a field in the database and/or a field is written in the current mask. |
Functions and commands for catenated instructionsIn order to enable the execution of complex database instructions (e.g. searches across several linked tables) many pieces of information are required. In order to keep these instructions flexible and clear a modular approach was selected to specify certain information by means of appropriate functions or commands. The following functions and commands are called from several action lines of a decision table. |
|
delete_ent | delete_ent({STR_EXPR| }) This command is used to open a virtual widget with the list mask for the specified entity, for which data records are to be deleted (temporarly). See also DataView function 'iwf_lis_ent'. |
delete_ref | delete_ref({STR_EXPR| }) This command is used to open a virtual widget with the list mask for the specified relationship to (temporarly) delete data records. See also DataView function 'iwf_lis_ref'. |
delete_typ | delete_typ({STR_EXPR| }) This command is used to open a virtual widget with the list mask for the specified type to (temporarly) delete data records. See also DataView function 'iwf_lis_typ'. |
exec_select |
{INT_VAR}= exec_select({NUM_EXPR}) or |
exec_update | exec_update() This command combines an Update instruction from the forwarded parameters of the previously called commands 'update' and 'where' and executes the update. |
execute | {INT_VAR}= execute({NUM_EXPR}) or {INT_VAR}= execute({NUM_EXPR},choose) This function combines a Select, Update, or Insert instruction from the forwarded parameters of the previously called commands and executes this instruction (using virtual widgets). Upon error-free execution it provides an integer value with the number of records. |
insert_ent | insert_ent({STR_EXPR| }) This command is used to open a virtual widget with the list mask for the specified entity to enter records. See also DataView function 'iwf_lis_ent'. |
insert_ref | insert_ref({STR_EXPR| }) This command is used to open a virtual widget with the list mask for the specified relationship to enter records. See also DataView function 'iwf_lis_ref'. |
insert_typ | insert_typ({STR_EXPR| }) This command is used to open a virtual widget with the list mask for the specified type to enter records. (See also DataView function 'iwf_lis_typ'.) |
order_by | order_by({ORD_LIST}) This command specifies the order for sorting the matching data of a catenated Select instruction ('select', 'where', 'order_by', 'exec_select'). Any number of sorting criteria is possible. |
select | select({VAR_LIST}) This command is used to specifiy the table fields of the database which is to be selected in case of a catenated Select instruction ('select', 'where', 'order_by', 'exec_select'). Moreover it specifies the variables for the assignment of the field contents. |
select_agg | select_agg({STR_EXPR| }) This command is used to open a virtual widget with the list mask for the specified aggregate relationship, from which records are to be selected. See also DataView function 'iwf_lis_agg'. |
select_ent | select_ent({STR_EXPR| }) This command is used to open a virtual widget with the list mask for the specified entity, from which records are to be selected. See also DataView function 'iwf_lis_ent'. |
select_ref | select_ref({STR_EXPR| }) This command is used to open a virtual widget with the list mask for the specified Refine relationship, from which records are to be selected. See also DataView function 'iwf_lis_ref'. |
select_typ | select_typ({STR_EXPR| }) This command is used to open a virtual widget with the list mask for the specified type, from which records are to be selected. See also DataView function 'iwf_lis_typ'. |
update | update({VAR_LIST}) This command determines the database table fields to be updated in case of a catenated Update instruction ('update', 'where', 'exec_update'). |
update_ent | update_ent({STR_EXPR| }) This command is used to open a virtual widget with the list mask for the specified entity, for which records are to be changed. See also DataView function 'iwf_lis_ent'. |
update_ref | update_ref({STR_EXPR| }) This command is used to open a virtual widget with the list mask for the specified relationship, for which records are to be changed. See also DataView function 'iwf_lis_ref'. |
update_typ | update_typ({STR_EXPR| }) This command is used to open a virtual widget with the list mask for the specified type, for which records are to be changed. See also DataView function 'iwf_lis_typ'. |
var | var({VAR_LIST}) This command determines the fields of the list mask written in catenated Update instructions respectively Insert instructions ('update_ent/update_ref/update_typ' resp. ' insert_ent/insert_ref/insert_typ', 'var', ' where_ent', ' where_ent2', ' execute') or read for cantenated Select instructions ('select_ent/select_ref/select_agg/select_typ', 'where_ent', 'where_ent2', 'where', 'exec_select', 'exec_update'). |
where | where({WHERE|actual}) or where(& {WHERE|DTV_JOIN}) or where( | {WHERE}) This command determines the Where clauses of catenated Selection or Update instructions. |
where_ent | where_ent({WHERE}| ) When changing, inserting, or selecting data from a relationship list (catenated Update resp. Insert instruction: 'update_ref' resp. 'insert_ref', 'where_ent', 'where_ent2', 'execute' or catenated Select instruction: 'select_agg'/'select_ref', 'where_ent', ' where', ' execute') the command specifies the parent of the relational list. |
where_ent2 | where_ent2({WHERE}| ) For catenated Insert instructions ('insert_ref', 'where_ent', 'where_ent2', 'execute') this command specifies the record of the second entity for the relational list. |