Lesson 6: Add code for the service functions
In EGL, I/O statements such as add and get access data that resides in different kinds of persistent data storage, from file systems to queues to databases. The coding is similar for the different cases.
About this task
In this lesson, you add functions that access rows in a relational database. Add the functions in order, before the final end statement in SQLService.egl.
Add a payment record
About this task
The addPayment() function adds a new
row to the database.
To code the function:
Procedure
Read all database records
About this task
The getAllPayments function reads all
of the records from the table and stores them in an array.
To code the function:
Procedure
Replace a record
About this task
The editPayment function replaces an
existing row in the database with an edited version. The function
assumes that the user previously read the row from the database.
To code the function:
Procedure
Delete a record
About this task
The deletePayment function deletes the
specified record from the table.
To code the function:
Procedure
Create test data
About this task
The createDefaultTable function creates
a set of data for testing your completed application.
To code the function:
Procedure
Lesson checkpoint
About this task
- Add embedded SQL code to a program and modify that code
- Automatically create and organize import statements
In the next lesson, you will create a widget to hold the table of expense data.



