CREATE CURSOR – SQL Command Example

The following example creates a cursor with the alias employee. A blank record is appended, filled, and displayed with the BROWSE command.

CLOSE DATABASES
CLEAR
CREATE CURSOR employee ;
 (EmpID N(5), Name C(20), Address C(30), City C(30), ;
  PostalCode C(10), OfficeNo C(8) NULL, Specialty M)
DISPLAY STRUCTURE
WAIT WINDOW "Press a key to add a record."

INSERT INTO employee (EmpId, Name, Address, City, PostalCode, ;
        OfficeNo, Specialty);
 VALUES (1002, "Dr. Bonnie Doren", "University of Oregon", "Eugene", ;
     "98403", "", "Secondary Special Education")
BROWSE

* At this point you could copy this record to a permanent table
CLOSE ALL   && Once the cursor is closed, all data is flushed
      && from memory
CLEAR