昨天刚好要写一个存储过程,因为平常没有经常接触,掉了一下坑,mark down下来提醒自己,上代码:
CREATE or replace PROCEDURE XXX
AS
i number;
BEGIN
for i in 0..10 loop
INSERT INTO XXX
(id,
name,
client_id,
client_secret,
federated_protocol,
redirect_uri,
description,
authz_scopes,
status,
zone_id,
creation_time,
last_update_time,
extension)
VALUES
(CONCAT('id', TO_CHAR(i)),
CONCAT('name', TO_CHAR(i)),
'OfficeClientID987576576-57657-0988',
'6LBhwfZMMpwyQbdLEexbXeb',
'OIDC',
'www.xxx.com',
'ooo370',
'email',
'1',
'01',
'1495175948670',
'1495175948672',
'ex');
end loop;
commit;
END;
BEGIN
XXX;
END;
执行完BEGIN END之后就可以循环插入进数据库,效果如下图: