[Home] [Help]
1143:
1144: -- delete table and column entries for cube
1145: delete zpb_columns
1146: where table_id=(select table_id
1147: from zpb_cubes
1148: where cube_id = p_cube_id);
1149:
1150: delete zpb_tables
1151: where table_id = (select table_id
1148: where cube_id = p_cube_id);
1149:
1150: delete zpb_tables
1151: where table_id = (select table_id
1152: from zpb_cubes
1153: where cube_id = p_cube_id);
1154:
1155: -- delete cube mapping entries (to dims and hierarchies)
1156: delete zpb_cube_dims
1159: delete zpb_cube_hier
1160: where cube_id = p_cube_id;
1161:
1162: -- finally delete cube entry
1163: delete zpb_cubes
1164: where cube_id = p_cube_id;
1165:
1166: end deleteCubeRecord;
1167:
1166: end deleteCubeRecord;
1167:
1168: -------------------------------------------------------------------------------
1169: -- insertCubeRecord - Private function that inserts a
1170: -- zpb_md_records.cubes_entry into zpb_cubes and
1171: -- returns the primary key of the newly created entry
1172: --
1173: -- if p_primary_key_provided is true, then the primary key for the
1174: -- cube to be inserted is provided and we do not select it from sequence
1190:
1191: begin
1192:
1193: select cube_id into l_cube_rec.CubeId
1194: from zpb_cubes
1195: where name = l_cube_rec.Name and
1196: bus_area_id = bus_area_id_num;
1197:
1198: update zpb_cubes
1194: from zpb_cubes
1195: where name = l_cube_rec.Name and
1196: bus_area_id = bus_area_id_num;
1197:
1198: update zpb_cubes
1199: set
1200: EPB_ID = l_cube_rec.EpbId,
1201: TABLE_ID = l_cube_rec.TableId,
1202: TYPE = l_cube_rec.Type,
1208: where cube_id = l_cube_rec.CubeId;
1209:
1210: exception
1211: when NO_DATA_FOUND then
1212: SELECT zpb_cubes_seq.NEXTVAL INTO l_cube_rec.CubeId FROM DUAL;
1213: insert_flag:=true;
1214: end;
1215:
1216: end if;
1216: end if;
1217:
1218: if insert_flag = true then
1219:
1220: insert into zpb_cubes
1221: (
1222: BUS_AREA_ID,
1223: CUBE_ID,
1224: EPB_ID,
3197:
3198: end BUILD_DIMS;
3199:
3200: -------------------------------------------------------------------------------
3201: -- BUILD_CUBE -Exposes metadata for a cube (zpb_cubes), its dimensionality
3202: -- (zpb_cube_dims) and its hierarchies (zpb_cube_hier)
3203: --
3204: -- IN: p_aw - The AW
3205: -- p_cubeView - The name of the cube
3538: l_column := zpb_aw.interp('shw '||l_measAw||l_global_ecm.MeasColVar);
3539:
3540: select count(*)
3541: into l_count
3542: from zpb_cubes
3543: where name = l_cube and
3544: bus_area_id = bus_area_id_num;
3545:
3546: if (l_count = 0) then
3650:
3651: -- expose MD for cube if has not been done so yet
3652: select count(*)
3653: into l_count
3654: from zpb_cubes
3655: where name = l_cube and
3656: bus_area_id = bus_area_id_num;
3657:
3658: if (l_count = 0) then
3690:
3691: -- expose MD for cube if it has not been done so yet
3692: select count(*)
3693: into l_count
3694: from zpb_cubes
3695: where name = l_cube and
3696: bus_area_id = bus_area_id_num;
3697:
3698: if (l_count = 0) then
3750: if l_cube <>'NA' then
3751:
3752: select count(*)
3753: into l_count
3754: from zpb_cubes
3755: where name = l_cube and
3756: bus_area_id = bus_area_id_num;
3757:
3758: if (l_count = 0) then
3818: if l_cube <>'NA' then
3819:
3820: select count(*)
3821: into l_count
3822: from zpb_cubes
3823: where name = l_cube and
3824: bus_area_id = bus_area_id_num;
3825:
3826: --dbms_output.put_line('l_count: ' || l_count);
4095:
4096: begin
4097:
4098: select cube_id, table_id into m_meas_en.cubeId, m_column_en.tableId
4099: from zpb_cubes
4100: where name = p_cube and
4101: bus_area_id = bus_area_id_num;
4102:
4103: l_insert_meas_flag := true;
4362: m_meas_en.CurrencyType := 'TempNA';
4363: m_meas_en.SelectedCur := 'TempNA';
4364:
4365: select cube_id, table_id into m_meas_en.cubeId, m_column_en.TableId
4366: from zpb_cubes
4367: where name = m_meas_cube_name and
4368: bus_area_id = bus_area_id_num;
4369:
4370: m_meas_en.ColumnId := InsertColumnRecord(m_column_en);
4389: -- m_meas_en.CurrencyType :='TempNA';
4390: -- m_meas_en.SelectedCur := 'TempNA';
4391:
4392: -- select cube_id, table_id into m_meas_en.cubeId, m_column_en.TableId
4393: -- from zpb_cubes
4394: -- where name = m_meas_cube_name and
4395: -- bus_area_id = bus_area_id_num;
4396:
4397: -- m_meas_en.columnId := InsertColumnRecord(m_column_en);
4808: l_cpr_meas_cube := l_cpr_meas_cube || '_PRS';
4809:
4810: -- cube table
4811: select table_name into m_table_en.TableName
4812: from zpb_cubes, zpb_tables
4813: where zpb_cubes.name = l_cpr_meas_cube and
4814: zpb_cubes.bus_area_id = bus_area_id_num and
4815: zpb_cubes.table_id = zpb_tables.table_id;
4816:
4809:
4810: -- cube table
4811: select table_name into m_table_en.TableName
4812: from zpb_cubes, zpb_tables
4813: where zpb_cubes.name = l_cpr_meas_cube and
4814: zpb_cubes.bus_area_id = bus_area_id_num and
4815: zpb_cubes.table_id = zpb_tables.table_id;
4816:
4817: else
4810: -- cube table
4811: select table_name into m_table_en.TableName
4812: from zpb_cubes, zpb_tables
4813: where zpb_cubes.name = l_cpr_meas_cube and
4814: zpb_cubes.bus_area_id = bus_area_id_num and
4815: zpb_cubes.table_id = zpb_tables.table_id;
4816:
4817: else
4818:
4811: select table_name into m_table_en.TableName
4812: from zpb_cubes, zpb_tables
4813: where zpb_cubes.name = l_cpr_meas_cube and
4814: zpb_cubes.bus_area_id = bus_area_id_num and
4815: zpb_cubes.table_id = zpb_tables.table_id;
4816:
4817: else
4818:
4819: m_table_en.TableName := zpb_metadata_names.get_exception_check_tbl(p_sharedAw);
4981: -- remove existing ownermap cube
4982: begin
4983:
4984: select cube_id into existing_cube
4985: from zpb_cubes
4986: where bus_area_id = bus_area_id_num and
4987: name like '%OWNERMAP%';
4988:
4989: deleteCubeRecord(existing_cube);
5168: l_instType||' DATA '||l_objName||'''');
5169:
5170: delete from zpb_measures
5171: where measure_id in
5172: (select measure_id from zpb_measures, zpb_cubes
5173: where zpb_measures.cube_id = zpb_cubes.cube_id and
5174: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5175: zpb_measures.epb_id= l_meas);
5176:
5169:
5170: delete from zpb_measures
5171: where measure_id in
5172: (select measure_id from zpb_measures, zpb_cubes
5173: where zpb_measures.cube_id = zpb_cubes.cube_id and
5174: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5175: zpb_measures.epb_id= l_meas);
5176:
5177: l_meas := zpb_aw.interp ('shw CM.GETINSTOBJECT('''||p_instance||''' '''||
5170: delete from zpb_measures
5171: where measure_id in
5172: (select measure_id from zpb_measures, zpb_cubes
5173: where zpb_measures.cube_id = zpb_cubes.cube_id and
5174: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5175: zpb_measures.epb_id= l_meas);
5176:
5177: l_meas := zpb_aw.interp ('shw CM.GETINSTOBJECT('''||p_instance||''' '''||
5178: l_instType||' ANNOTATION '||l_objName||'''');
5178: l_instType||' ANNOTATION '||l_objName||'''');
5179:
5180: delete from zpb_measures
5181: where measure_id in
5182: (select measure_id from zpb_measures, zpb_cubes
5183: where zpb_measures.cube_id = zpb_cubes.cube_id and
5184: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5185: zpb_measures.epb_id= l_meas);
5186:
5179:
5180: delete from zpb_measures
5181: where measure_id in
5182: (select measure_id from zpb_measures, zpb_cubes
5183: where zpb_measures.cube_id = zpb_cubes.cube_id and
5184: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5185: zpb_measures.epb_id= l_meas);
5186:
5187: l_meas := zpb_aw.interp ('shw CM.GETINSTOBJECT('''||p_instance||''' '''||
5180: delete from zpb_measures
5181: where measure_id in
5182: (select measure_id from zpb_measures, zpb_cubes
5183: where zpb_measures.cube_id = zpb_cubes.cube_id and
5184: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5185: zpb_measures.epb_id= l_meas);
5186:
5187: l_meas := zpb_aw.interp ('shw CM.GETINSTOBJECT('''||p_instance||''' '''||
5188: l_instType||' FORMAT '||l_objName||'''');
5187: l_meas := zpb_aw.interp ('shw CM.GETINSTOBJECT('''||p_instance||''' '''||
5188: l_instType||' FORMAT '||l_objName||'''');
5189: delete from zpb_measures
5190: where measure_id in
5191: (select measure_id from zpb_measures, zpb_cubes
5192: where zpb_measures.cube_id = zpb_cubes.cube_id and
5193: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5194: zpb_measures.epb_id= l_meas);
5195:
5188: l_instType||' FORMAT '||l_objName||'''');
5189: delete from zpb_measures
5190: where measure_id in
5191: (select measure_id from zpb_measures, zpb_cubes
5192: where zpb_measures.cube_id = zpb_cubes.cube_id and
5193: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5194: zpb_measures.epb_id= l_meas);
5195:
5196: if (p_type = 'PERSONAL') then
5189: delete from zpb_measures
5190: where measure_id in
5191: (select measure_id from zpb_measures, zpb_cubes
5192: where zpb_measures.cube_id = zpb_cubes.cube_id and
5193: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5194: zpb_measures.epb_id= l_meas);
5195:
5196: if (p_type = 'PERSONAL') then
5197: l_instance := to_number(zpb_aw.interp('shw CM.GETPHYSICALINSTANCE('''||
5200: into l_count
5201: from ZPB_MEASURES
5202: where INSTANCE_ID = l_instance
5203: and TYPE = 'PERSONAL_DATA'
5204: and CUBE_ID in (select CUBE_ID from ZPB_CUBES
5205: where NAME like '%'||p_aw||'/_%' escape '/');
5206: if (l_count > 0) then
5207: l_dltWriteSec := false;
5208: else
5216: l_meas := zpb_aw.interp ('shw CM.GETINSTOBJECT('''||p_instance||''' '''||
5217: l_instType||' WRITE SECURITY '||l_objName||'''');
5218: delete from zpb_measures
5219: where measure_id in
5220: (select measure_id from zpb_measures, zpb_cubes
5221: where zpb_measures.cube_id = zpb_cubes.cube_id and
5222: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5223: zpb_measures.epb_id= l_meas);
5224: end if;
5217: l_instType||' WRITE SECURITY '||l_objName||'''');
5218: delete from zpb_measures
5219: where measure_id in
5220: (select measure_id from zpb_measures, zpb_cubes
5221: where zpb_measures.cube_id = zpb_cubes.cube_id and
5222: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5223: zpb_measures.epb_id= l_meas);
5224: end if;
5225:
5218: delete from zpb_measures
5219: where measure_id in
5220: (select measure_id from zpb_measures, zpb_cubes
5221: where zpb_measures.cube_id = zpb_cubes.cube_id and
5222: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5223: zpb_measures.epb_id= l_meas);
5224: end if;
5225:
5226: if (p_type = 'PERSONAL' or p_type = 'SHARED') then
5227: l_meas := zpb_aw.interp ('shw CM.GETINSTOBJECT('''||p_instance||''' '''||
5228: l_instType||' TARGET '||l_objName||'''');
5229: delete from zpb_measures
5230: where measure_id in
5231: (select measure_id from zpb_measures, zpb_cubes
5232: where zpb_measures.cube_id = zpb_cubes.cube_id and
5233: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5234: zpb_measures.epb_id= l_meas);
5235:
5228: l_instType||' TARGET '||l_objName||'''');
5229: delete from zpb_measures
5230: where measure_id in
5231: (select measure_id from zpb_measures, zpb_cubes
5232: where zpb_measures.cube_id = zpb_cubes.cube_id and
5233: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5234: zpb_measures.epb_id= l_meas);
5235:
5236: l_meas := zpb_aw.interp ('shw CM.GETINSTOBJECT('''||p_instance||''' '''||
5229: delete from zpb_measures
5230: where measure_id in
5231: (select measure_id from zpb_measures, zpb_cubes
5232: where zpb_measures.cube_id = zpb_cubes.cube_id and
5233: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5234: zpb_measures.epb_id= l_meas);
5235:
5236: l_meas := zpb_aw.interp ('shw CM.GETINSTOBJECT('''||p_instance||''' '''||
5237: l_instType||' TARGET TYPE '||l_objName||'''');
5236: l_meas := zpb_aw.interp ('shw CM.GETINSTOBJECT('''||p_instance||''' '''||
5237: l_instType||' TARGET TYPE '||l_objName||'''');
5238: delete from zpb_measures
5239: where measure_id in
5240: (select measure_id from zpb_measures, zpb_cubes
5241: where zpb_measures.cube_id = zpb_cubes.cube_id and
5242: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5243: zpb_measures.epb_id= l_meas);
5244:
5237: l_instType||' TARGET TYPE '||l_objName||'''');
5238: delete from zpb_measures
5239: where measure_id in
5240: (select measure_id from zpb_measures, zpb_cubes
5241: where zpb_measures.cube_id = zpb_cubes.cube_id and
5242: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5243: zpb_measures.epb_id= l_meas);
5244:
5245: if (l_dltWriteSec) then
5238: delete from zpb_measures
5239: where measure_id in
5240: (select measure_id from zpb_measures, zpb_cubes
5241: where zpb_measures.cube_id = zpb_cubes.cube_id and
5242: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5243: zpb_measures.epb_id= l_meas);
5244:
5245: if (l_dltWriteSec) then
5246: l_meas := zpb_aw.interp ('shw CM.GETINSTOBJECT('''||p_instance||''' '''||
5246: l_meas := zpb_aw.interp ('shw CM.GETINSTOBJECT('''||p_instance||''' '''||
5247: l_instType||' INPUT LEVEL OBJECT ID''');
5248: delete from zpb_measures
5249: where measure_id in
5250: (select measure_id from zpb_measures, zpb_cubes
5251: where zpb_measures.cube_id = zpb_cubes.cube_id and
5252: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5253: zpb_measures.epb_id= l_meas);
5254: end if;
5247: l_instType||' INPUT LEVEL OBJECT ID''');
5248: delete from zpb_measures
5249: where measure_id in
5250: (select measure_id from zpb_measures, zpb_cubes
5251: where zpb_measures.cube_id = zpb_cubes.cube_id and
5252: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5253: zpb_measures.epb_id= l_meas);
5254: end if;
5255: end if;
5248: delete from zpb_measures
5249: where measure_id in
5250: (select measure_id from zpb_measures, zpb_cubes
5251: where zpb_measures.cube_id = zpb_cubes.cube_id and
5252: zpb_cubes.name like '%'||p_aw||'/_%' escape '/' and
5253: zpb_measures.epb_id= l_meas);
5254: end if;
5255: end if;
5256: end if;
5266: bus_area_id_num number;
5267:
5268: cursor cubes_cursor is
5269: select cube_id
5270: from zpb_cubes
5271: where bus_area_id = bus_area_id_num and
5272: name like p_sharaw || '%';
5273:
5274: begin
5293: bus_area_id_num number;
5294:
5295: cursor cubes_cursor is
5296: select cube_id
5297: from zpb_cubes
5298: where bus_area_id = bus_area_id_num and
5299: name like p_user || '/_%' escape '/';
5300:
5301: begin
5866: v_table c_tables%ROWTYPE;
5867:
5868: CURSOR c_cubes is
5869: select cube_id
5870: from zpb_cubes
5871: where bus_area_id = p_bus_area_id;
5872:
5873: v_cube c_cubes%ROWTYPE;
5874: