Using cursors for database query

example1 demonstrates how to use cursors in an interactive query program. The program: