Example 1: Using cursors for database query

Example 1 shows how to use cursors in an interactive query program. Following is the sample’s program flow. The program: