使用AO新增記錄的3種方法

2022-02-28 01:43:21 字數 1247 閱讀 2271

內容摘要

在向table、featureclass 中新增記錄的時候有幾種可供選用的插入方法

他們在不同的使用環境中效率不同……

過程描述

-------------

1 store 方法

使用irow、ifeature 的store

由itable 或 ifeatureclass 的 createrow() createfeature() 方法先建立物件經賦值操作後呼叫 store

此方法在各種環境中速度均較低 但其獲得的資訊相對最全 適用於經ui互動產生的資料物件

a)在createrow() 時進行一次資料庫訪問 [insert]

b)建立之後已row中已返回 oid 值

c)其他字段賦值之後呼叫store 進行第二次資料庫訪問 [updata] 此時激發 row物件的 onchange等事件呼叫

--------------

2 writerow方法

使用itablewrite.writerow() 或 ifeatureclasswrite.writefeature()

由itable 或 ifeatureclass 的 createrow() createfeature() 方法先建立物件

經賦值操作後呼叫 itable.writerow() 或 ifeatureclass.writefeature()

此方法呼叫itablewrite這類較底層的介面 區別在於在寫入資料時不會激發相應事件

在物件不影響網路拓撲結構的前提下寫入幾何網路圖層資料速度較快

a)在createrow() 時進行一次資料庫訪問 [insert]

b)建立之後已row中已返回 oid 值

c)其他字段賦值之後呼叫store 進行第二次資料庫訪問 [updata] 此時不激發事件

-----------------

3 insert buffer

使用itable.createrowbuffer() 或 ifeatureclass.createfeaturebuffer()建立記憶體物件

由ifeaturecursor.insertfeature()寫入只訪問一次資料庫速度較快 但是記憶體物件在寫入前

oid=-1 適用於批量寫入簡單要素

a)在createrowbuffer() 建立記憶體物件

b)建立之後已row中oid = -1

c)其他字段賦值之後呼叫icursor.insert() 進行一次資料庫插入 此時不會相應事件

from:

新增不存在記錄的3種方法

當我們a表 b表都包含相同資訊 如使用者資訊 現在需要向a表插入在b表中不存在的紀錄。我們有3種常見的方法來完成1 insert a select from b where id not in select id from a 2 insert a select from b where not e...

ECLIPSE 新增外掛程式3種方法

eclipse 新增外掛程式有3中方法 第一種 解壓eclipse 外掛程式 裡面分別包含兩個資料夾features和plugins 然後把兩個資料夾分別複製到eclipse 下所對應的資料夾下。刪除 configuration資料夾下的 org.eclipse.update資料夾。重新啟動ecli...

CRC的3種方法

一.crc16演算法 首先在原始檔標頭檔案加入錶值 cpp view plain copy print?crc16碼表 static word const wcrc16table 256 crc16碼表 static word const wcrc16table 256 然後在檔案中加入下列函式 c...