rowscopy, 拷貝帶有自增字段的表

2021-04-01 09:16:46 字數 998 閱讀 8626

1.清除本地資料

ls_sql1 = "truncate table" + ls_table [1]

execute immediate :ls_sql1 using sqlca; 

2.//開啟可以插入自增,顯示插入自增字段的值

ls_sql1 = "set identity_insert " + ls_table [1] + " on"

execute immediate :ls_sql1 using sqlca;

3.構造資料視窗,或datastore

4.wf_set_iden_off_1(dw_1)  //關掉本地datastore的自增

wf_set_iden_off_1內容:

//將指定datastore 的自增欄位設定為 off

string ls_colcount

long ll_colcount, i

string ls_colname

ls_colcount = ar_ds.describe("datawindow.column.count")

if integer (ls_colcount) > 0 then

ll_colcount = integer (ls_colcount)

else

return

end if

string ls_on, ls_err

for i = 1 to ll_colcount

ls_colname = ar_ds.describe("#" + string(i) +".name")

ls_on = ar_ds.describe("#" + string(i) +".identity")

if ls_on = 'yes' then

ar_ds.modify (ls_colname + ".identity = 'no'" )

end if  

next

5.開始copy,

6.update

結束

php中mysql自增 MySQL的自增欄位

1.關鍵字 auto increment 2.自增用法 例 create table animals id mediumint not null auto increment,name char 30 not nu 1.關鍵字 auto increment 2.自增用法 例 create table...

laravel 中某一欄位自增 自減

increment自增方法有兩個引數 第乙個為必填,代表要對資料表的哪個字段進行自增操作,第二個引數為可選,如果為空則表示每次遞增1,如果填寫了比如3,則表示每次在原有的基礎上遞增3。db table users increment votes db table users increment vo...

sqlserver查詢出某個表當前自增字段的最新值

通常我們在設計表的時候,會加乙個排序字段,為的是方便資料的排序,比如上移 下移。如果在給資料表插入資料的時候,想要使這個欄位的預設值跟資料庫的主鍵 主鍵是自增長 一致的話,該怎麼弄呢?先插入,然後取出剛剛插入的資料的主鍵,然後對這行資料更新,將排序的值更新為主鍵的值?理論上這樣做也能實現,但是如果併...