Back to Contents


Genero BDL Tutorial Summary

If you are a developer new to Genero and the Business Development Language, this tutorial is designed for you, to explain concepts and provide code examples for some of the common business-related tasks. The only prerequisite knowledge you must have is familiarity with relational databases and SQL.

The chapters contain a series of programs that range in complexity from simple procedures, such as displaying a database row, through more advanced topics, such as handling arrays and master-detail relationships.  Each chapter contains a general discussion of the features and programming techniques used in the programs, together with annotated code samples. The examples in later chapters build on concepts and functions explained in earlier chapters.

In addition to reading through the tutorial and its examples, you can run the example programs and try the programming techniques described in this tutorial if you wish. Before creating the custdemo database and testing the example programs, the following requirements must be met:

The example database is designed to be as generic as possible, so it can be implemented on various relational database systems. The steps to create the sample database are:

  1.  Using your database system software, create an empty database named custdemo with logging enabled.
  2.  Execute the SQL statements in the file custdemo.sql to create tables in the custdemo database.
  3.  Execute the SQL statements in the file loadcust.sql to insert rows into the tables of the database.

Many of the programs require that a database schema file  for the custdemo database is generated. Use fgldbsch for database schema generation.

The example programs shown in this tutorial have the BDL keywords in uppercase letters; this is a convention only.  For ease in reading, the BDL keywords are colored green. 

The line numbers shown in the example programs are for the user's reference only; they are not a part of the BDL code.


Tutorial Chapters

Chapter Description
1 - BDL Concepts

This chapter provides a basic explanation of Genero BDL concepts, and includes sections on compiling and deploying your applications. The "Resources" section provides a roadmap to the documentation and example code available to programmers.

2 - Using BDL This chapter illustrates the structure of a BDL program and some of the BDL statements that do some common tasks - display a text message to the screen, connect to a database and retrieving data, define variables, and pass variables between functions. A row from the customer table of the custdemo example database is retrieved by an SQL statement and displayed to the user.
3 - Record Display This chapter illustrates opening a window that contains a form to display information to the user. An SQL statement is used to retrieve the data. The actions to retrieve data or to exit are defined in a MENU statement, and displayed as buttons on the form.  A form specification file is defined to display the values retrieved from the database. 
4 - Searching the Database (Query By Example) The program in this chapter implements query-by-example, using the CONSTRUCT statement to allow the user to enter search criteria in a form.  The search criteria is used to build an SQL SELECT statement which will retrieve rows from the customer database table.  A SCROLL CURSOR is defined in the program, to allow the user to scroll back and forth between the rows of the result set.  Testing the success of the SQL statements and handling errors is illustrated.
5 - GUI Options Program forms can be displayed in a variety of ways. This chapter illustrates adding a Toolbar or a Topmenu (pulldown menu) by modifying the form specification file, changing the window's appearance, and disabling/enabling actions. The example programs in this chapter use some of the action defaults defined by Genero BDL to standardize the presentation of common actions to the user.
6 - Insert/Update/Delete This program allows the user to insert/update/delete rows in the customer database table.  Embedded SQL statements (UPDATE/INSERT/DELETE) are used to update the table, based on the values stored in the program record.  SQL transactions, and concurrency and consistency issues are discussed.  Prior to deleting a row, a dialog window is displayed to prompt the user to verify the deletion.
7 - Array Display

Unlike the previous programs, the example in this chapter displays multiple customer records at once.  The program defines a program array to hold the records, and displays the records in a form containing a TABLE and a screen array.  The example program is expanded to use the DISPLAY ARRAY statement in paged mode, to dynamically fill the array as needed.  This program illustrates a library function - the example is written so it can be used in multiple programs, maximizing code re-use.

8 - Array Input The program in this chapter uses a form and a screen array to allow the user to view and change multiple records of a program array at once.  The INPUT ARRAY statement and its control blocks  are used by the program to control and monitor the changes made by the user to the records. As each record in the program array is Added, Updated, or Deleted,  the program logic makes corresponding changes in the rows of the customer database table. 
9 - Reports This chapter's program generates a simple report of the data in the customer database table. The two parts of a report, the report driver logic and the REPORT program block (report definition) are illustrated.  A technique to allow a user to interrupt a long-running report is shown.
10 - Localization Localization Support and Localized Strings allow you to internationalize your application using different languages, and to customize it for specific industry markets in your user population. This chapter illustrates the use of Localized Strings in your programs.
11 - Master/Detail The form used by the program in this chapter contains fields from both the orders and items tables in the custdemo database, illustrating a master-detail relationship.  Since there are multiple items associated with a single order, the rows from the items table are stored in a program array and displayed in a TABLE container on the form.  This chapter focuses on the master/detail form and the unique features of the corresponding program.