Relational Database Informix-4GL Program Design
1. Key and methods for designing relational database programs
1. Key factors for successfully designing a relational database:
①. Gain an in-depth understanding of internal organizations and needs of the enterprise;
②. Always maintain interaction and contact with end users;
③ Structured development methods should be used in the design process to facilitate maintenance;
④. Use the ergraph to represent the data structure model.
2. Structured Open methods are divided into stages during the entire application development cycle:
①. Feasibility Report for system development;
②. Functional requirements of the program;
③. Technical Design System Specification );
④ Programming and Testing source code list );
5. user training and implementation User Manual ).
6. Program maintenance and upgrade.
3. database design methods and steps:
①. Get an analysis of the enterprise's understanding needs );
②. Identify the main data object entities, attributes, and contacts );
③. Use the erdiagram to plot the preliminary erdiagram of the Data Object );
④ Solve Logical Data Type handling contact and remove redundancy );
⑤. Determine the detailed data type of the attribute );
6. normalize the logic model;
7. Use SQL DDL to convert the logical model to the physical DB mode.
Ii. Informix-4gl syntax rules
1. Program body structure:
DATABASE
GLOBALS ### define global variables
DEFINE variable name 1 variable type,
Variable name n variable type
ENDGLOBALS or GLOBALS "glob.4gl"
MAIN
DEFINE variable name 1 variable type,
Variable name n variable type
OPTIONSPROMPTLINE1,
ERRORLINE24,
MESSAGELINE24,
COMMENTLINE24,
FORMLINE4,
MENULINE4,
Nextkeycontrol-n,
Previuskeycontrol-p,
Deletekeycontrol-o,
Insertkeycontrol-I,
ACCEPTKEYINTERRUPT, ### the ESC key is invalid.
INPUTWRAP ### store data by pressing the accept key
DEFERINTERRUPT ### prevent illegal interruptions
Setisolationtodirtyread
Setlockmodetowait5
Whenevererrorcontinue ### continue execution when an error occurs
Callstartlog ("slif_err.log ")
... (Other program statements)
... (User Function)
ENDMAIN
2. The specific syntax of the program:
①. Command line parameters:
Arg_val [0]: indicates the command itself
Arg_val [1]: Indicates command line parameter 1
Arg_val [n]: Specifies the command line parameter n.
Sum_args (): Total number of test command line parameters
2. program variables:
All fields except serial can be of the database field type.