記錄一次oracle批量插入操作

2021-10-10 07:21:05 字數 1120 閱讀 1698

begin

insert into t_police_person(id, name, birthday, cardno, ***, departmentid, policeid, callgroup, callno, callgpsid, telephone,

position, mobilephone, address, email, image, policetype, establishment, dutytype, status, sequenceid, isdelete,

addtime, updatetime) values

(#||lpad(seq_t_police_person.nextval,6,0),

#, #,

#, #,

#, #,

#, #,

#, #,

#, #,

#, #,

#, #,

#, #,

#, #,

#, #,

#);end;

拼接符號 || 

補全函式:左  lpan('abdc','補全位數','要不全的數值')   lpad( string, padded_length, [ pad_string ] ) 

lpad是在字串左邊用設定的字元補滿指定位數,rpad則是右邊

如lpad('1234',8,'0')  的結果是00001234

rpad('1234',8,'0') 的結果則是12340000

insert into t_police_call(id, deviceid, gpsid, frequency, departmentid, factoryname, model, registerdate,

status, remark, addtime, updatetime)

select seq_t_police_call.nextval, pc.* from (

(select #,

#,#,

#,#,

#,#,

#,#,

#,# from dual)

) pc

記錄一次oracle使用記錄

使用oracle資料庫的專案到我這邊,需要修改,咱雖然 學過 oracle,但那畢竟已經過去了。哈哈。使用database configuration assistant 建立資料庫,建立快完的時候,說我沒有監聽啥的,然後 通過 net manager 建立了,qizhong1 其中選中的那個就是建...

SQL 一次插入多條記錄 例句

新增多條記錄 insert into tablename col1,col2,col3 select 1,2,3 union all select 4,5,6 union all select 7,8,9從另外的一張表中讀取多條資料新增到新錶中 insert into tablename col1,...

oracle一次插入多條資料

insert into 表名 欄位1,欄位2 select 一 二 from dual union all select 三 四 from dual union all select 五 六 from dual union all select 七 八 from dual union all sel...