阅读:1391回复:0
ArcSDE C-API 开发:添加新要素基本步骤:
代码: * Define the columns to be filled in on insert */ num_cols = 4; attrs = (CHAR **) malloc (num_cols * sizeof(CHAR *)); attrs[0] = "city_name"; attrs[1] = "area"; attrs[2] = "population"; attrs[3] = "boundary";
/* Tell the stream that you are inserting new records into the table */ rc = SE_stream_insert_table (Stream, "cities", num_cols, attrs); /* See Error handling section for check_error function code. */ check_error(NULL, Stream, rc, "SE_stream_insert_table");
/* For each record to be inserted into the table */ while (more data exists for insert;ldots;) { rc = SE_stream_set_string (Stream, 1, city_name); check_error(NULL, Stream, rc, "SE_stream_set_string");
rc = SE_stream_set_double (Stream, 2, area); check_error(NULL, Stream, rc, "SE_stream_set_double");
rc = SE_stream_set_integer (Stream, 3, population); check_error(NULL, Stream, rc, "SE_stream_set_integer");
rc = SE_stream_set_shape (Stream, 4, shape); check_error(NULL, Stream, rc, "SE_stream_set_shape");
rc = SE_stream_execute (Stream); check_error(NULL, Stream, rc, "SE_stream_execute"); } |
|
|