oracle自定义类型 示例

时间:2024-04-03 14:06:20
CREATE OR REPLACE TYPE varchar_array is VARRAY(30) OF VARCHAR2(32);

---自定义类型传参给存储过程,示例如下:

create or replace procedure dropWf is
cursor c_tenant is
select t.jdbc_username, t.JDBC_PASSWORD from ADM_OA_03.MT_TENANT t where t.status = 1 and t.id not in ('T024', 'T001', 'T008');
c_row c_tenant%rowtype;
wftbs varchar_array;
begin
for c_row in c_tenant loop
--droporgtbl(c_row.jdbc_username);
wftbs := varchar_array(
'WF_DEF_CATEGORY',
'WF_DEF_FORMAT',
'WF_DEF_OPINION',
'WF_DEF_OPINION_CATEGORY',
'WF_FLOW_DEFINITION',
'WF_FLOW_INSTANCE',
'WF_FLOW_INSTANCE_PARAM',
'WF_FLOW_MANAGEMENT',
'WF_FLOW_SCHEMA',
'WF_FLOW_SCHEMA_LOG',
'WF_TASK_ACTIVITY',
'WF_TASK_COUNTER_SIGN',
'WF_TASK_DELEGATION',
'WF_TASK_DELETE_LOG',
'WF_TASK_FORM_OPINION',
'WF_TASK_FORM_OPINION_LOG',
'WF_TASK_IDENTITY',
'WF_TASK_INSTANCE',
'WF_TASK_OPERATION',
'WF_TASK_SUB_FLOW',
'WF_TASK_SUB_FLOW_RELATION',
'WF_TASK_TIMER',
'WF_TASK_TIMER_LOG',
'WF_TASK_TIMER_USER',
'WF_TASK_TRANSFER'
);
droptbls(c_row.jdbc_username, wftbs);
end loop;
end dropWf;