400: l_dynamic_rows := dbms_sql.execute(l_dynamic_cursor);
401: dbms_sql.close_cursor(l_dynamic_cursor);
402: exception
403: when others then
404: htp.p('SQL being executed was: '||l_dynamic_call||'
');
405: htp.p(SQLERRM);
406: end;
407: end if;
408: else
401: dbms_sql.close_cursor(l_dynamic_cursor);
402: exception
403: when others then
404: htp.p('SQL being executed was: '||l_dynamic_call||'
');
405: htp.p(SQLERRM);
406: end;
407: end if;
408: else
409: l_dyn_mode := EXECUTABLE;
417: and (nvl(vars(var).parent_related_id, 0) = nvl(p_parent_related_id, 0))) then
418: if l_dyn_mode = VARIABLE then
419: if vars(var).value is not null then
420: if (replace_tab_num = l_replace_text_table.LAST) then
421: htp.p(vars(var).value);
422: else
423: htp.prn(vars(var).value);
424: end if;
425: end if;
419: if vars(var).value is not null then
420: if (replace_tab_num = l_replace_text_table.LAST) then
421: htp.p(vars(var).value);
422: else
423: htp.prn(vars(var).value);
424: end if;
425: end if;
426: else
427: l_dynamic_call := l_dynamic_call||vars(var).value;
435: else
436: if l_dyn_mode = VARIABLE then
437: if l_replace_text_table(replace_tab_num).replace_text is not null then
438: if (replace_tab_num = l_replace_text_table.LAST) then
439: htp.p(l_replace_text_table(replace_tab_num).replace_text);
440: else
441: htp.prn(l_replace_text_table(replace_tab_num).replace_text);
442: end if;
443: end if;
437: if l_replace_text_table(replace_tab_num).replace_text is not null then
438: if (replace_tab_num = l_replace_text_table.LAST) then
439: htp.p(l_replace_text_table(replace_tab_num).replace_text);
440: else
441: htp.prn(l_replace_text_table(replace_tab_num).replace_text);
442: end if;
443: end if;
444: else
445: l_dyn_end := instr(l_replace_text_table(replace_tab_num).replace_text, '!#');
454: l_dynamic_rows := dbms_sql.execute(l_dynamic_cursor);
455: dbms_sql.close_cursor(l_dynamic_cursor);
456: exception
457: when others then
458: htp.p('SQL being executed was: '||l_dynamic_call||'
');
459: htp.p(SQLERRM);
460: end;
461: l_dyn_mode := VARIABLE;
462: end if;
455: dbms_sql.close_cursor(l_dynamic_cursor);
456: exception
457: when others then
458: htp.p('SQL being executed was: '||l_dynamic_call||'
');
459: htp.p(SQLERRM);
460: end;
461: l_dyn_mode := VARIABLE;
462: end if;
463: else
469: end loop;
470:
471: -- write loop break text if current row is divisible by break #
472: if mod(l_replace_count_w, l_first_group_tag_loop_table(3)) = 0 then
473: htp.p(l_first_group_tag_loop_table(4));
474: end if;
475:
476:
477: -- check for child related tags and recurse if necessary
511: while length(l_html_piece) > 0 loop
512: l_tag_beginning := instr(l_html_piece,'<~!');
513: if l_tag_beginning = 0 then
514: -- no special tags left, print rest of html and exit loop
515: htp.prn(l_html_piece);
516: l_html_piece := '';
517: exit;
518: else
519: -- print out and discard html up to the special tag
516: l_html_piece := '';
517: exit;
518: else
519: -- print out and discard html up to the special tag
520: htp.prn(substr(l_html_piece, 1, l_tag_beginning - 1));
521: l_html_piece := substr(l_html_piece, l_tag_beginning);
522: end if;
523:
524: -- count number of tags to check for grouped tags
834: end loop;
835:
836: exception
837: when TAG_DOES_NOT_EXIST then
838: htp.p(l_tag_name||': Special tag does not exist.');
839: when TAG_NOT_UNIQUE then
840: htp.p(l_tag_name||': Special tag is not unique.');
841: when TAG_VAR_NO_END then
842: htp.p(l_tag_name||': Special tag has a tag variable format error. Each tag variable should start with [ and end with ].');
836: exception
837: when TAG_DOES_NOT_EXIST then
838: htp.p(l_tag_name||': Special tag does not exist.');
839: when TAG_NOT_UNIQUE then
840: htp.p(l_tag_name||': Special tag is not unique.');
841: when TAG_VAR_NO_END then
842: htp.p(l_tag_name||': Special tag has a tag variable format error. Each tag variable should start with [ and end with ].');
843: when TAG_NO_END then
844: htp.p('Special tag has no end.');
838: htp.p(l_tag_name||': Special tag does not exist.');
839: when TAG_NOT_UNIQUE then
840: htp.p(l_tag_name||': Special tag is not unique.');
841: when TAG_VAR_NO_END then
842: htp.p(l_tag_name||': Special tag has a tag variable format error. Each tag variable should start with [ and end with ].');
843: when TAG_NO_END then
844: htp.p('Special tag has no end.');
845: when TAG_SYNTAX_ERROR then
846: htp.p(l_tag_name||': Special tag has syntax errors.');
840: htp.p(l_tag_name||': Special tag is not unique.');
841: when TAG_VAR_NO_END then
842: htp.p(l_tag_name||': Special tag has a tag variable format error. Each tag variable should start with [ and end with ].');
843: when TAG_NO_END then
844: htp.p('Special tag has no end.');
845: when TAG_SYNTAX_ERROR then
846: htp.p(l_tag_name||': Special tag has syntax errors.');
847: when others then
848: htp.p(SQLERRM);
842: htp.p(l_tag_name||': Special tag has a tag variable format error. Each tag variable should start with [ and end with ].');
843: when TAG_NO_END then
844: htp.p('Special tag has no end.');
845: when TAG_SYNTAX_ERROR then
846: htp.p(l_tag_name||': Special tag has syntax errors.');
847: when others then
848: htp.p(SQLERRM);
849:
850: end parse;
844: htp.p('Special tag has no end.');
845: when TAG_SYNTAX_ERROR then
846: htp.p(l_tag_name||': Special tag has syntax errors.');
847: when others then
848: htp.p(SQLERRM);
849:
850: end parse;
851:
852:
871: -- end fix bug 924513
872:
873: -- write out html file
874: for piece in l_html_pieces.FIRST..l_html_pieces.LAST loop
875: htp.p(l_html_pieces(piece));
876: end loop;
877: end if;
878: end get_HTML_file;
879:
883: p_message_name in varchar2) is
884:
885: begin
886: FND_MESSAGE.SET_NAME(p_app_code, p_message_name);
887: htp.p(FND_MESSAGE.Get);
888: end;
889:
890:
891:
893: procedure print_variables is
894:
895: begin
896:
897: htp.tableOpen('BORDER=1');
898: htp.tableRowOpen;
899: htp.tableData('row number');
900: htp.tableData('variable_name');
901: htp.tableData('sequence');
894:
895: begin
896:
897: htp.tableOpen('BORDER=1');
898: htp.tableRowOpen;
899: htp.tableData('row number');
900: htp.tableData('variable_name');
901: htp.tableData('sequence');
902: htp.tableData('value');
895: begin
896:
897: htp.tableOpen('BORDER=1');
898: htp.tableRowOpen;
899: htp.tableData('row number');
900: htp.tableData('variable_name');
901: htp.tableData('sequence');
902: htp.tableData('value');
903: htp.tableData('related id');
896:
897: htp.tableOpen('BORDER=1');
898: htp.tableRowOpen;
899: htp.tableData('row number');
900: htp.tableData('variable_name');
901: htp.tableData('sequence');
902: htp.tableData('value');
903: htp.tableData('related id');
904: htp.tableData('parent name');
897: htp.tableOpen('BORDER=1');
898: htp.tableRowOpen;
899: htp.tableData('row number');
900: htp.tableData('variable_name');
901: htp.tableData('sequence');
902: htp.tableData('value');
903: htp.tableData('related id');
904: htp.tableData('parent name');
905: htp.tableData('parent related id');
898: htp.tableRowOpen;
899: htp.tableData('row number');
900: htp.tableData('variable_name');
901: htp.tableData('sequence');
902: htp.tableData('value');
903: htp.tableData('related id');
904: htp.tableData('parent name');
905: htp.tableData('parent related id');
906: htp.tableRowClose;
899: htp.tableData('row number');
900: htp.tableData('variable_name');
901: htp.tableData('sequence');
902: htp.tableData('value');
903: htp.tableData('related id');
904: htp.tableData('parent name');
905: htp.tableData('parent related id');
906: htp.tableRowClose;
907:
900: htp.tableData('variable_name');
901: htp.tableData('sequence');
902: htp.tableData('value');
903: htp.tableData('related id');
904: htp.tableData('parent name');
905: htp.tableData('parent related id');
906: htp.tableRowClose;
907:
908: for i in 1..vars.COUNT loop
901: htp.tableData('sequence');
902: htp.tableData('value');
903: htp.tableData('related id');
904: htp.tableData('parent name');
905: htp.tableData('parent related id');
906: htp.tableRowClose;
907:
908: for i in 1..vars.COUNT loop
909: htp.tableRowOpen;
902: htp.tableData('value');
903: htp.tableData('related id');
904: htp.tableData('parent name');
905: htp.tableData('parent related id');
906: htp.tableRowClose;
907:
908: for i in 1..vars.COUNT loop
909: htp.tableRowOpen;
910: htp.tableData(i);
905: htp.tableData('parent related id');
906: htp.tableRowClose;
907:
908: for i in 1..vars.COUNT loop
909: htp.tableRowOpen;
910: htp.tableData(i);
911: htp.tableData(vars(i).variable_name);
912: htp.tableData(vars(i).sequence);
913: htp.tableData(vars(i).value);
906: htp.tableRowClose;
907:
908: for i in 1..vars.COUNT loop
909: htp.tableRowOpen;
910: htp.tableData(i);
911: htp.tableData(vars(i).variable_name);
912: htp.tableData(vars(i).sequence);
913: htp.tableData(vars(i).value);
914: htp.tableData(vars(i).related_id);
907:
908: for i in 1..vars.COUNT loop
909: htp.tableRowOpen;
910: htp.tableData(i);
911: htp.tableData(vars(i).variable_name);
912: htp.tableData(vars(i).sequence);
913: htp.tableData(vars(i).value);
914: htp.tableData(vars(i).related_id);
915: htp.tableData(vars(i).parent_name);
908: for i in 1..vars.COUNT loop
909: htp.tableRowOpen;
910: htp.tableData(i);
911: htp.tableData(vars(i).variable_name);
912: htp.tableData(vars(i).sequence);
913: htp.tableData(vars(i).value);
914: htp.tableData(vars(i).related_id);
915: htp.tableData(vars(i).parent_name);
916: htp.tableData(vars(i).parent_related_id);
909: htp.tableRowOpen;
910: htp.tableData(i);
911: htp.tableData(vars(i).variable_name);
912: htp.tableData(vars(i).sequence);
913: htp.tableData(vars(i).value);
914: htp.tableData(vars(i).related_id);
915: htp.tableData(vars(i).parent_name);
916: htp.tableData(vars(i).parent_related_id);
917: htp.tableRowClose;
910: htp.tableData(i);
911: htp.tableData(vars(i).variable_name);
912: htp.tableData(vars(i).sequence);
913: htp.tableData(vars(i).value);
914: htp.tableData(vars(i).related_id);
915: htp.tableData(vars(i).parent_name);
916: htp.tableData(vars(i).parent_related_id);
917: htp.tableRowClose;
918: end loop;
911: htp.tableData(vars(i).variable_name);
912: htp.tableData(vars(i).sequence);
913: htp.tableData(vars(i).value);
914: htp.tableData(vars(i).related_id);
915: htp.tableData(vars(i).parent_name);
916: htp.tableData(vars(i).parent_related_id);
917: htp.tableRowClose;
918: end loop;
919: htp.tableClose;
912: htp.tableData(vars(i).sequence);
913: htp.tableData(vars(i).value);
914: htp.tableData(vars(i).related_id);
915: htp.tableData(vars(i).parent_name);
916: htp.tableData(vars(i).parent_related_id);
917: htp.tableRowClose;
918: end loop;
919: htp.tableClose;
920:
913: htp.tableData(vars(i).value);
914: htp.tableData(vars(i).related_id);
915: htp.tableData(vars(i).parent_name);
916: htp.tableData(vars(i).parent_related_id);
917: htp.tableRowClose;
918: end loop;
919: htp.tableClose;
920:
921: end;
915: htp.tableData(vars(i).parent_name);
916: htp.tableData(vars(i).parent_related_id);
917: htp.tableRowClose;
918: end loop;
919: htp.tableClose;
920:
921: end;
922:
923: