昨天剛好要寫一個存儲過程愈诚,因為平常沒有經(jīng)常接觸邮绿,掉了一下坑烛谊,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;
執(zhí)行完BEGIN ?END之后就可以循環(huán)插入進數(shù)據(jù)庫嗜浮,效果如下圖: