| 6028 | | declare |
|---|
| 6029 | | uncommitted_count number(20) := 0; |
|---|
| 6030 | | |
|---|
| 6031 | | cursor source_cursor is |
|---|
| 6032 | | select |
|---|
| 6033 | | ps.project_id, |
|---|
| 6034 | | shg.group_id |
|---|
| 6035 | | from |
|---|
| 6036 | | pn_project_space ps, |
|---|
| 6037 | | pn_space_has_group shg |
|---|
| 6038 | | where |
|---|
| 6039 | | ps.project_id = shg.space_id(+); |
|---|
| 6040 | | begin |
|---|
| 6041 | | for rec in source_cursor loop |
|---|
| 6042 | | --insert new entry in module_permission for this row |
|---|
| 6043 | | insert into pn_module_permission |
|---|
| 6044 | | (space_id, group_id, module_id, actions) |
|---|
| 6045 | | values |
|---|
| 6046 | | (rec.project_id, rec.group_id, 340, 207); |
|---|
| 6047 | | |
|---|
| 6048 | | uncommitted_count := uncommitted_count + 1; |
|---|
| 6049 | | |
|---|
| 6050 | | --Commit every 50th insert to make sure we don't overflow |
|---|
| 6051 | | --rollback log. |
|---|
| 6052 | | if (uncommitted_count >=50) then |
|---|
| 6053 | | commit; |
|---|
| 6054 | | uncommitted_count := 0; |
|---|
| 6055 | | end if; |
|---|
| 6056 | | end loop; |
|---|
| 6057 | | |
|---|
| 6058 | | --Commit any remaining insertions |
|---|
| 6059 | | commit; |
|---|
| 6060 | | exception |
|---|
| 6061 | | when others then |
|---|
| 6062 | | begin |
|---|
| 6063 | | dbms_output.put_line('Error occurred while updating module permissions for wiki.'); |
|---|
| 6064 | | raise; |
|---|
| 6065 | | end; |
|---|
| 6066 | | end; |
|---|
| 6067 | | / |
|---|
| 6068 | | |
|---|