create cursor – sql 命令示例

下面的示例创建了一个别名为 employee 的临时表。并添加一条新记录, 填入字段并用 browse 命令浏览数据。

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