[Home] [Help]
35:
36: --nbarik - 10/21/03 - bug fix 3201277 - Added function name here
37: cursor getViewBy (cpUserId varchar2, cpSessionId varchar2) is
38: select session_value
39: from bis_user_attributes
40: where user_id = cpUserId
41: and session_id = cpSessionId
42: and function_name = pFunctionName
43: and attribute_name = 'VIEW_BY';
45: --nbarik - 10/21/03 - bug fix 3201277
46: /*
47: cursor getTimeAttribute (cpUserId varchar2, cpSessionId varchar2) is
48: select attribute_name
49: from bis_user_attributes
50: where user_id = cpUserId
51: and session_id = cpSessionId
52: and ( attribute_name like 'TIME%' or attribute_name like 'EDW_TIME_M%' );
53: */
88: ELSIF ( instr(lTimeDimLevel,'_TO') > 1 ) THEN
89: lTimeDimLevels := substr( lTimeDimLevel ,1,instr( lTimeDimLevel ,'_TO')-1);
90: END IF;
91:
92: DELETE FROM bis_user_attributes where session_id= pSessionId AND function_name= pFunctionName
93: AND schedule_id is null
94: AND user_id=pUserId
95: AND attribute_name = 'VIEW_BY';
96:
93: AND schedule_id is null
94: AND user_id=pUserId
95: AND attribute_name = 'VIEW_BY';
96:
97: INSERT INTO BIS_USER_ATTRIBUTES (user_id, function_name,
98: session_id, attribute_name,
99: session_value,
100: dimension,
101: creation_date, created_by,
190: );
191: ELSE
192:
193: --0) delete all the existing session parameters
194: DELETE FROM bis_user_attributes
195: WHERE function_name=pFunctionName
196: AND user_id=pUserId
197: AND session_id=pSessionId
198: AND schedule_id IS NULL;
322: where ak.region_code = rtrim(cpRegionCode)
323: and ak.node_query_flag = 'Y'
324: AND nvl(substr(ak.attribute2,1,instr(ak.attribute2,'+')-1), ak.attribute_code) NOT IN (
325: select DISTINCT nvl(substr(b.attribute_name,1,instr(b.attribute_name,'+')-1), attribute_code)
326: from bis_user_attributes b
327: where b.page_id=pPageId
328: and b.user_id =pUserId
329: )
330: order by display_sequence;
353: where region_code=cpNestedRegionCode
354: and node_query_flag='Y'
355: and nvl(substr(attribute2,1,instr(attribute2,'+')-1), attribute_code) not in (
356: SELECT DISTINCT nvl(substr(attribute_name ,1,instr(attribute_name ,'+')-1), attribute_code)
357: FROM bis_user_attributes
358: WHERE page_id=pPageId
359: AND user_id=pUserId
360: )
361: UNION
365: WHERE region_code= rtrim(cpRegionCode)
366: AND node_query_flag='Y'
367: AND nvl(substr(attribute2,1,instr(attribute2,'+')-1), attribute_code) NOT IN (
368: SELECT DISTINCT nvl( substr(attribute_name ,1,instr(attribute_name ,'+')-1), attribute_code)
369: FROM bis_user_attributes
370: WHERE page_id=pPageId
371: AND user_id=pUserId
372: UNION
373: SELECT DISTINCT nvl( substr(attribute2,1,instr(attribute2,'+')-1), attribute_code)
377: ORDER BY display_sequence;
378:
379: cursor getViewBy (cpUserId varchar2, cpSessionId varchar2) is
380: select session_value
381: from bis_user_attributes
382: where user_id = cpUserId
383: and session_id = cpSessionId
384: and attribute_name = 'VIEW_BY';
385:
384: and attribute_name = 'VIEW_BY';
385:
386: cursor getTimeAttribute (cpUserId varchar2, cpSessionId varchar2) is
387: select attribute_name
388: from bis_user_attributes
389: where user_id = cpUserId
390: and session_id = cpSessionId
391: and ( attribute_name like 'TIME%' or attribute_name like 'EDW_TIME_M%' );
392:
412: --delete all the paramete rs for this session for this report only if this is not a recursive drill into the same
413: -- report, else will lose the data
414: --jprabhud added the OR clause for enhancement #2442162
415: IF (pFunctionName <> pPreFunctionName OR pPreFunctionName IS NULL) THEN
416: DELETE FROM bis_user_attributes
417: WHERE function_name=pFunctionName
418: AND user_id=pUserId
419: AND session_id=pSessionId
420: AND schedule_id IS NULL;
429: close getNestedRegionCode;
430:
431: IF pPageId is not null then
432: -- elete the page parameters
433: DELETE FROM bis_user_attributes where session_id= pSessionId AND function_name= pFunctionName
434: AND schedule_id is null
435: AND user_id=pUserId
436: AND attribute_name in
437: (SELECT attribute_name from bis_user_attributes where user_id=pUserId and page_id=pPageId);
433: DELETE FROM bis_user_attributes where session_id= pSessionId AND function_name= pFunctionName
434: AND schedule_id is null
435: AND user_id=pUserId
436: AND attribute_name in
437: (SELECT attribute_name from bis_user_attributes where user_id=pUserId and page_id=pPageId);
438:
439: -- copy the page level parameters
440: insert into bis_user_attributes (USER_ID,
441: FUNCTION_NAME,
436: AND attribute_name in
437: (SELECT attribute_name from bis_user_attributes where user_id=pUserId and page_id=pPageId);
438:
439: -- copy the page level parameters
440: insert into bis_user_attributes (USER_ID,
441: FUNCTION_NAME,
442: SESSION_ID,
443: SESSION_VALUE,
444: SESSION_DESCRIPTION,
452: SESSION_DESCRIPTION,
453: ATTRIBUTE_NAME,
454: DIMENSION,
455: PERIOD_DATE
456: FROM bis_user_attributes
457: where user_id = pUserId
458: AND page_id = pPageId;
459:
460: END IF;
465: -- tothe function which is not needed for self drilling
466: IF (pScheduleId IS NULL) THEN
467: RETURN;
468: ELSE
469: DELETE FROM bis_user_attributes where session_id= pSessionId AND function_name= pFunctionName
470: and schedule_id is null AND user_id=pUserId
471: AND attribute_name in
472: (SELECT attribute_name from bis_user_attributes where schedule_id=pSCheduleId);
473:
468: ELSE
469: DELETE FROM bis_user_attributes where session_id= pSessionId AND function_name= pFunctionName
470: and schedule_id is null AND user_id=pUserId
471: AND attribute_name in
472: (SELECT attribute_name from bis_user_attributes where schedule_id=pSCheduleId);
473:
474: -- for time from
475: DELETE FROM bis_user_attributes where session_id= pSessionId AND function_name= pFunctionName
476: and schedule_id is null AND user_id=pUserId
471: AND attribute_name in
472: (SELECT attribute_name from bis_user_attributes where schedule_id=pSCheduleId);
473:
474: -- for time from
475: DELETE FROM bis_user_attributes where session_id= pSessionId AND function_name= pFunctionName
476: and schedule_id is null AND user_id=pUserId
477: AND attribute_name in
478: (SELECT attribute_name||'_FROM' from bis_user_attributes where schedule_id=pSCheduleId);
479:
474: -- for time from
475: DELETE FROM bis_user_attributes where session_id= pSessionId AND function_name= pFunctionName
476: and schedule_id is null AND user_id=pUserId
477: AND attribute_name in
478: (SELECT attribute_name||'_FROM' from bis_user_attributes where schedule_id=pSCheduleId);
479:
480: -- for time to
481: DELETE FROM bis_user_attributes where session_id= pSessionId AND function_name= pFunctionName
482: and schedule_id is null AND user_id=pUserId
477: AND attribute_name in
478: (SELECT attribute_name||'_FROM' from bis_user_attributes where schedule_id=pSCheduleId);
479:
480: -- for time to
481: DELETE FROM bis_user_attributes where session_id= pSessionId AND function_name= pFunctionName
482: and schedule_id is null AND user_id=pUserId
483: AND attribute_name in
484: (SELECT attribute_name||'_TO' from bis_user_attributes where schedule_id=pSCheduleId);
485:
480: -- for time to
481: DELETE FROM bis_user_attributes where session_id= pSessionId AND function_name= pFunctionName
482: and schedule_id is null AND user_id=pUserId
483: AND attribute_name in
484: (SELECT attribute_name||'_TO' from bis_user_attributes where schedule_id=pSCheduleId);
485:
486: END IF;
487:
488: END IF;
532: vAttributeCodeTable(vAttributeCodeTable.COUNT+1) := 'BIS_P_ASOF_DATE';
533: for i in vAttributeCodeTable.FIRST..vAttributeCodeTable.LAST loop
534:
535: if pScheduleId is null then
536: insert into bis_user_attributes (USER_ID,
537: FUNCTION_NAME,
538: SESSION_ID,
539: SESSION_VALUE,
540: SESSION_DESCRIPTION,
548: SESSION_DESCRIPTION,
549: ATTRIBUTE_NAME,
550: DIMENSION,
551: PERIOD_DATE
552: from bis_user_attributes
553: where function_name = pPreFunctionName
554: and attribute_name in (vAttributeCodeTable(i),
555: vAttributeCodeTable(i)||'_FROM',
556: vAttributeCodeTable(i)||'_TO')
556: vAttributeCodeTable(i)||'_TO')
557: and session_id = pSessionId
558: and user_id = pUserId;
559: else
560: insert into bis_user_attributes (USER_ID,
561: FUNCTION_NAME,
562: SESSION_ID,
563: SESSION_VALUE,
564: SESSION_DESCRIPTION,
572: SESSION_DESCRIPTION,
573: ATTRIBUTE_NAME,
574: DIMENSION,
575: PERIOD_DATE
576: from bis_user_attributes
577: where schedule_id = pScheduleId
578: and attribute_name in (vAttributeCodeTable(i),
579: vAttributeCodeTable(i)||'_FROM',
580: vAttributeCodeTable(i)||'_TO');
584: if vDimensionTable(i) = vOldDimension then
585: goto endLoop;
586: else
587: if pScheduleId is null then
588: insert into bis_user_attributes (USER_ID,
589: FUNCTION_NAME,
590: SESSION_ID,
591: SESSION_VALUE,
592: SESSION_DESCRIPTION,
600: SESSION_DESCRIPTION,
601: ATTRIBUTE_NAME,
602: DIMENSION,
603: PERIOD_DATE
604: from bis_user_attributes
605: where function_name = pPreFunctionName
606: and attribute_name = vDimensionTable(i)||'_HIERARCHY'
607: and session_id = pSessionId
608: and user_id = pUserId;
609: else
610: -- if drilling into itself, there is a possibility that this parameter has not been
611: --deleted from the current session
612: --IF (pFunctionName == pPreFunctionName) THEN
613: DELETE FROM bis_user_attributes
614: WHERE session_id =pSessionId
615: AND function_name = pFunctionName
616: AND schedule_id IS NULL
617: AND user_id=pUserId
617: AND user_id=pUserId
618: AND attribute_name = vDimensionTable(i)||'_HIERARCHY';
619: --END IF;
620:
621: insert into bis_user_attributes (USER_ID,
622: FUNCTION_NAME,
623: SESSION_ID,
624: SESSION_VALUE,
625: SESSION_DESCRIPTION,
633: SESSION_DESCRIPTION,
634: ATTRIBUTE_NAME,
635: DIMENSION,
636: PERIOD_DATE
637: from bis_user_attributes
638: where schedule_id = pScheduleId
639: and attribute_name = vDimensionTable(i)||'_HIERARCHY';
640:
641: end if;
694: ELSIF ( instr(lTimeDimLevel,'_TO') > 1 ) THEN
695: lTimeDimLevels := substr( lTimeDimLevel ,1,instr( lTimeDimLevel ,'_TO')-1);
696: END IF;
697:
698: DELETE FROM bis_user_attributes where session_id= pSessionId AND function_name= pFunctionName
699: AND schedule_id is null
700: AND user_id=pUserId
701: AND attribute_name = 'VIEW_BY';
702:
699: AND schedule_id is null
700: AND user_id=pUserId
701: AND attribute_name = 'VIEW_BY';
702:
703: INSERT INTO BIS_USER_ATTRIBUTES (user_id, function_name,
704: session_id, attribute_name,
705: session_value,
706: dimension,
707: creation_date, created_by,