From 2429a065311327407f0fae28a633e7a9a98bc523 Mon Sep 17 00:00:00 2001 From: Jan Kvetina Date: Tue, 11 Jan 2022 22:31:35 +0100 Subject: [PATCH] Show table constraints --- apex/f770/application/pages/page_00951.sql | 643 +++++++++++++++++++-- views/obj_constraints.sql | 67 +++ 2 files changed, 671 insertions(+), 39 deletions(-) create mode 100644 views/obj_constraints.sql diff --git a/apex/f770/application/pages/page_00951.sql b/apex/f770/application/pages/page_00951.sql index 8cf88e5..62aec7a 100644 --- a/apex/f770/application/pages/page_00951.sql +++ b/apex/f770/application/pages/page_00951.sql @@ -74,6 +74,569 @@ wwv_flow_api.create_page_plug( ,p_attribute_01=>'N' ,p_attribute_02=>'HTML' ); +wwv_flow_api.create_page_plug( + p_id=>wwv_flow_api.id(15126400769615747) +,p_plug_name=>'Constraints' +,p_region_css_classes=>'SHORT' +,p_region_template_options=>'#DEFAULT#:t-HeroRegion--hideIcon' +,p_plug_template=>wwv_flow_api.id(9070356145569920) +,p_plug_display_sequence=>70 +,p_include_in_reg_disp_sel_yn=>'Y' +,p_plug_display_point=>'BODY' +,p_plug_query_options=>'DERIVED_REPORT_COLUMNS' +,p_plug_display_condition_type=>'ITEM_IS_NOT_NULL' +,p_plug_display_when_condition=>'P951_TABLE_NAME' +,p_attribute_01=>'N' +,p_attribute_02=>'HTML' +); +wwv_flow_api.create_page_plug( + p_id=>wwv_flow_api.id(15126571796615748) +,p_plug_name=>'Constraints [GRID]' +,p_region_name=>'CONSTRAINTS' +,p_region_template_options=>'#DEFAULT#' +,p_component_template_options=>'#DEFAULT#' +,p_plug_template=>wwv_flow_api.id(9078290074569925) +,p_plug_display_sequence=>80 +,p_include_in_reg_disp_sel_yn=>'Y' +,p_plug_display_point=>'BODY' +,p_query_type=>'TABLE' +,p_query_table=>'OBJ_CONSTRAINTS' +,p_include_rowid_column=>false +,p_plug_source_type=>'NATIVE_IG' +,p_plug_query_options=>'DERIVED_REPORT_COLUMNS' +,p_plug_display_condition_type=>'ITEM_IS_NOT_NULL' +,p_plug_display_when_condition=>'P951_TABLE_NAME' +,p_prn_units=>'MILLIMETERS' +,p_prn_paper_size=>'A4' +,p_prn_width=>297 +,p_prn_height=>210 +,p_prn_orientation=>'HORIZONTAL' +,p_prn_page_header=>'Constraints [GRID]' +,p_prn_page_header_font_color=>'#000000' +,p_prn_page_header_font_family=>'Helvetica' +,p_prn_page_header_font_weight=>'normal' +,p_prn_page_header_font_size=>'12' +,p_prn_page_footer_font_color=>'#000000' +,p_prn_page_footer_font_family=>'Helvetica' +,p_prn_page_footer_font_weight=>'normal' +,p_prn_page_footer_font_size=>'12' +,p_prn_header_bg_color=>'#EEEEEE' +,p_prn_header_font_color=>'#000000' +,p_prn_header_font_family=>'Helvetica' +,p_prn_header_font_weight=>'bold' +,p_prn_header_font_size=>'10' +,p_prn_body_bg_color=>'#FFFFFF' +,p_prn_body_font_color=>'#000000' +,p_prn_body_font_family=>'Helvetica' +,p_prn_body_font_weight=>'normal' +,p_prn_body_font_size=>'10' +,p_prn_border_width=>.5 +,p_prn_page_header_alignment=>'CENTER' +,p_prn_page_footer_alignment=>'CENTER' +,p_prn_border_color=>'#666666' +); +wwv_flow_api.create_region_column_group( + p_id=>wwv_flow_api.id(15338192751749813) +,p_heading=>'Constraint' +); +wwv_flow_api.create_region_column_group( + p_id=>wwv_flow_api.id(15338232772749814) +,p_heading=>'Referenced Table' +); +wwv_flow_api.create_region_column_group( + p_id=>wwv_flow_api.id(15338396301749815) +,p_heading=>'Flags' +); +wwv_flow_api.create_region_column( + p_id=>wwv_flow_api.id(15126794710615750) +,p_name=>'TABLE_NAME' +,p_source_type=>'DB_COLUMN' +,p_source_expression=>'TABLE_NAME' +,p_data_type=>'VARCHAR2' +,p_is_query_only=>false +,p_item_type=>'NATIVE_TEXTAREA' +,p_heading=>'Table Name' +,p_heading_alignment=>'LEFT' +,p_display_sequence=>10 +,p_value_alignment=>'LEFT' +,p_group_id=>wwv_flow_api.id(15338192751749813) +,p_use_group_for=>'BOTH' +,p_attribute_01=>'Y' +,p_attribute_02=>'N' +,p_attribute_03=>'N' +,p_attribute_04=>'BOTH' +,p_is_required=>true +,p_max_length=>128 +,p_enable_filter=>true +,p_filter_operators=>'C:S:CASE_INSENSITIVE:REGEXP' +,p_filter_is_required=>false +,p_filter_text_case=>'MIXED' +,p_filter_lov_type=>'NONE' +,p_use_as_row_header=>false +,p_enable_sort_group=>true +,p_enable_control_break=>true +,p_enable_hide=>true +,p_is_primary_key=>false +,p_duplicate_value=>true +,p_include_in_export=>true +); +wwv_flow_api.create_region_column( + p_id=>wwv_flow_api.id(15336946122749801) +,p_name=>'CONSTRAINT_TYPE' +,p_source_type=>'DB_COLUMN' +,p_source_expression=>'CONSTRAINT_TYPE' +,p_data_type=>'VARCHAR2' +,p_is_query_only=>false +,p_item_type=>'NATIVE_TEXT_FIELD' +,p_heading=>'Type' +,p_heading_alignment=>'CENTER' +,p_display_sequence=>20 +,p_value_alignment=>'CENTER' +,p_group_id=>wwv_flow_api.id(15338192751749813) +,p_use_group_for=>'BOTH' +,p_attribute_05=>'BOTH' +,p_is_required=>false +,p_max_length=>1 +,p_enable_filter=>true +,p_filter_operators=>'C:S:CASE_INSENSITIVE:REGEXP' +,p_filter_is_required=>false +,p_filter_text_case=>'MIXED' +,p_filter_exact_match=>true +,p_filter_lov_type=>'DISTINCT' +,p_use_as_row_header=>false +,p_enable_sort_group=>true +,p_enable_control_break=>true +,p_enable_hide=>true +,p_is_primary_key=>false +,p_duplicate_value=>true +,p_include_in_export=>true +); +wwv_flow_api.create_region_column( + p_id=>wwv_flow_api.id(15337027370749802) +,p_name=>'CONSTRAINT_NAME' +,p_source_type=>'DB_COLUMN' +,p_source_expression=>'CONSTRAINT_NAME' +,p_data_type=>'VARCHAR2' +,p_is_query_only=>false +,p_item_type=>'NATIVE_TEXTAREA' +,p_heading=>'Name' +,p_heading_alignment=>'LEFT' +,p_display_sequence=>30 +,p_value_alignment=>'LEFT' +,p_group_id=>wwv_flow_api.id(15338192751749813) +,p_use_group_for=>'BOTH' +,p_attribute_01=>'Y' +,p_attribute_02=>'N' +,p_attribute_03=>'N' +,p_attribute_04=>'BOTH' +,p_is_required=>true +,p_max_length=>128 +,p_enable_filter=>true +,p_filter_operators=>'C:S:CASE_INSENSITIVE:REGEXP' +,p_filter_is_required=>false +,p_filter_text_case=>'MIXED' +,p_filter_lov_type=>'NONE' +,p_use_as_row_header=>false +,p_enable_sort_group=>true +,p_enable_control_break=>true +,p_enable_hide=>true +,p_is_primary_key=>false +,p_duplicate_value=>true +,p_include_in_export=>true +); +wwv_flow_api.create_region_column( + p_id=>wwv_flow_api.id(15337391876749805) +,p_name=>'IS_DISABLED' +,p_source_type=>'DB_COLUMN' +,p_source_expression=>'IS_DISABLED' +,p_data_type=>'VARCHAR2' +,p_is_query_only=>false +,p_item_type=>'NATIVE_SINGLE_CHECKBOX' +,p_heading=>'Disabled' +,p_heading_alignment=>'CENTER' +,p_display_sequence=>80 +,p_value_alignment=>'CENTER' +,p_group_id=>wwv_flow_api.id(15338396301749815) +,p_use_group_for=>'BOTH' +,p_attribute_01=>'N' +,p_attribute_02=>'Y' +,p_is_required=>false +,p_enable_filter=>true +,p_filter_operators=>'C:S:CASE_INSENSITIVE:REGEXP' +,p_filter_is_required=>false +,p_filter_text_case=>'MIXED' +,p_filter_exact_match=>true +,p_filter_lov_type=>'DISTINCT' +,p_use_as_row_header=>false +,p_enable_sort_group=>true +,p_enable_control_break=>true +,p_enable_hide=>true +,p_is_primary_key=>false +,p_duplicate_value=>true +,p_include_in_export=>true +); +wwv_flow_api.create_region_column( + p_id=>wwv_flow_api.id(15337406732749806) +,p_name=>'IS_GENERATED' +,p_source_type=>'DB_COLUMN' +,p_source_expression=>'IS_GENERATED' +,p_data_type=>'VARCHAR2' +,p_is_query_only=>false +,p_item_type=>'NATIVE_SINGLE_CHECKBOX' +,p_heading=>'Generated' +,p_heading_alignment=>'CENTER' +,p_display_sequence=>90 +,p_value_alignment=>'CENTER' +,p_group_id=>wwv_flow_api.id(15338396301749815) +,p_use_group_for=>'BOTH' +,p_attribute_01=>'N' +,p_attribute_02=>'Y' +,p_is_required=>false +,p_enable_filter=>true +,p_filter_operators=>'C:S:CASE_INSENSITIVE:REGEXP' +,p_filter_is_required=>false +,p_filter_text_case=>'MIXED' +,p_filter_exact_match=>true +,p_filter_lov_type=>'DISTINCT' +,p_use_as_row_header=>false +,p_enable_sort_group=>true +,p_enable_control_break=>true +,p_enable_hide=>true +,p_is_primary_key=>false +,p_duplicate_value=>true +,p_include_in_export=>true +); +wwv_flow_api.create_region_column( + p_id=>wwv_flow_api.id(15337584912749807) +,p_name=>'COLS' +,p_source_type=>'DB_COLUMN' +,p_source_expression=>'COLS' +,p_data_type=>'VARCHAR2' +,p_is_query_only=>false +,p_item_type=>'NATIVE_TEXTAREA' +,p_heading=>'Columns' +,p_heading_alignment=>'LEFT' +,p_display_sequence=>40 +,p_value_alignment=>'LEFT' +,p_group_id=>wwv_flow_api.id(15338192751749813) +,p_use_group_for=>'BOTH' +,p_attribute_01=>'Y' +,p_attribute_02=>'N' +,p_attribute_03=>'N' +,p_attribute_04=>'BOTH' +,p_is_required=>false +,p_max_length=>32767 +,p_enable_filter=>true +,p_filter_operators=>'C:S:CASE_INSENSITIVE:REGEXP' +,p_filter_is_required=>false +,p_filter_text_case=>'MIXED' +,p_filter_lov_type=>'NONE' +,p_use_as_row_header=>false +,p_enable_sort_group=>false +,p_enable_hide=>true +,p_is_primary_key=>false +,p_duplicate_value=>true +,p_include_in_export=>true +); +wwv_flow_api.create_region_column( + p_id=>wwv_flow_api.id(15337687266749808) +,p_name=>'PRIMARY_TABLE' +,p_source_type=>'DB_COLUMN' +,p_source_expression=>'PRIMARY_TABLE' +,p_data_type=>'VARCHAR2' +,p_is_query_only=>false +,p_item_type=>'NATIVE_LINK' +,p_heading=>'Table Name' +,p_heading_alignment=>'LEFT' +,p_display_sequence=>50 +,p_value_alignment=>'LEFT' +,p_group_id=>wwv_flow_api.id(15338232772749814) +,p_use_group_for=>'BOTH' +,p_link_target=>'f?p=&APP_ID.:951:&SESSION.::&DEBUG.:951:P951_TABLE_NAME:&TABLE_NAME.' +,p_link_text=>'&PRIMARY_TABLE.' +,p_enable_filter=>true +,p_filter_operators=>'C:S:CASE_INSENSITIVE:REGEXP' +,p_filter_is_required=>false +,p_filter_text_case=>'MIXED' +,p_filter_lov_type=>'NONE' +,p_use_as_row_header=>false +,p_enable_sort_group=>false +,p_enable_hide=>true +,p_is_primary_key=>false +,p_duplicate_value=>true +,p_include_in_export=>true +,p_escape_on_http_output=>true +); +wwv_flow_api.create_region_column( + p_id=>wwv_flow_api.id(15337780023749809) +,p_name=>'PRIMARY_COLS' +,p_source_type=>'DB_COLUMN' +,p_source_expression=>'PRIMARY_COLS' +,p_data_type=>'VARCHAR2' +,p_is_query_only=>false +,p_item_type=>'NATIVE_TEXTAREA' +,p_heading=>'Columns' +,p_heading_alignment=>'LEFT' +,p_display_sequence=>60 +,p_value_alignment=>'LEFT' +,p_group_id=>wwv_flow_api.id(15338232772749814) +,p_use_group_for=>'BOTH' +,p_attribute_01=>'Y' +,p_attribute_02=>'N' +,p_attribute_03=>'N' +,p_attribute_04=>'BOTH' +,p_is_required=>false +,p_max_length=>32767 +,p_enable_filter=>true +,p_filter_operators=>'C:S:CASE_INSENSITIVE:REGEXP' +,p_filter_is_required=>false +,p_filter_text_case=>'MIXED' +,p_filter_lov_type=>'NONE' +,p_use_as_row_header=>false +,p_enable_sort_group=>false +,p_enable_hide=>true +,p_is_primary_key=>false +,p_duplicate_value=>true +,p_include_in_export=>true +); +wwv_flow_api.create_region_column( + p_id=>wwv_flow_api.id(15337831598749810) +,p_name=>'PRIMARY_CONSTRAINT' +,p_source_type=>'DB_COLUMN' +,p_source_expression=>'PRIMARY_CONSTRAINT' +,p_data_type=>'VARCHAR2' +,p_is_query_only=>false +,p_item_type=>'NATIVE_TEXTAREA' +,p_heading=>'Constraint' +,p_heading_alignment=>'LEFT' +,p_display_sequence=>70 +,p_value_alignment=>'LEFT' +,p_group_id=>wwv_flow_api.id(15338232772749814) +,p_use_group_for=>'BOTH' +,p_attribute_01=>'Y' +,p_attribute_02=>'N' +,p_attribute_03=>'N' +,p_attribute_04=>'BOTH' +,p_is_required=>false +,p_max_length=>128 +,p_enable_filter=>true +,p_filter_operators=>'C:S:CASE_INSENSITIVE:REGEXP' +,p_filter_is_required=>false +,p_filter_text_case=>'MIXED' +,p_filter_lov_type=>'NONE' +,p_use_as_row_header=>false +,p_enable_sort_group=>false +,p_enable_hide=>true +,p_is_primary_key=>false +,p_duplicate_value=>true +,p_include_in_export=>true +); +wwv_flow_api.create_region_column( + p_id=>wwv_flow_api.id(15337955174749811) +,p_name=>'IS_DEFERRED' +,p_source_type=>'DB_COLUMN' +,p_source_expression=>'IS_DEFERRED' +,p_data_type=>'VARCHAR2' +,p_is_query_only=>false +,p_item_type=>'NATIVE_SINGLE_CHECKBOX' +,p_heading=>'Deferred' +,p_heading_alignment=>'CENTER' +,p_display_sequence=>100 +,p_value_alignment=>'CENTER' +,p_group_id=>wwv_flow_api.id(15338396301749815) +,p_use_group_for=>'BOTH' +,p_attribute_01=>'N' +,p_attribute_02=>'Y' +,p_is_required=>false +,p_enable_filter=>true +,p_filter_operators=>'C:S:CASE_INSENSITIVE:REGEXP' +,p_filter_is_required=>false +,p_filter_text_case=>'MIXED' +,p_filter_exact_match=>true +,p_filter_lov_type=>'DISTINCT' +,p_use_as_row_header=>false +,p_enable_sort_group=>true +,p_enable_control_break=>true +,p_enable_hide=>true +,p_is_primary_key=>false +,p_duplicate_value=>true +,p_include_in_export=>true +); +wwv_flow_api.create_region_column( + p_id=>wwv_flow_api.id(15338093819749812) +,p_name=>'DELETE_RULE' +,p_source_type=>'DB_COLUMN' +,p_source_expression=>'DELETE_RULE' +,p_data_type=>'VARCHAR2' +,p_is_query_only=>false +,p_item_type=>'NATIVE_TEXT_FIELD' +,p_heading=>'Delete Rule' +,p_heading_alignment=>'LEFT' +,p_display_sequence=>110 +,p_value_alignment=>'LEFT' +,p_attribute_05=>'BOTH' +,p_is_required=>false +,p_max_length=>9 +,p_enable_filter=>true +,p_filter_operators=>'C:S:CASE_INSENSITIVE:REGEXP' +,p_filter_is_required=>false +,p_filter_text_case=>'MIXED' +,p_filter_exact_match=>true +,p_filter_lov_type=>'DISTINCT' +,p_use_as_row_header=>false +,p_enable_sort_group=>true +,p_enable_control_break=>true +,p_enable_hide=>true +,p_is_primary_key=>false +,p_duplicate_value=>true +,p_include_in_export=>true +); +wwv_flow_api.create_interactive_grid( + p_id=>wwv_flow_api.id(15126630885615749) +,p_internal_uid=>15126630885615749 +,p_is_editable=>false +,p_lazy_loading=>false +,p_requires_filter=>false +,p_select_first_row=>false +,p_fixed_row_height=>true +,p_pagination_type=>'SET' +,p_show_total_row_count=>true +,p_show_toolbar=>true +,p_toolbar_buttons=>'SEARCH_COLUMN:SEARCH_FIELD:ACTIONS_MENU:SAVE' +,p_enable_save_public_report=>false +,p_enable_subscriptions=>true +,p_enable_flashback=>true +,p_define_chart_view=>true +,p_enable_download=>true +,p_download_formats=>'CSV:HTML:XLSX:PDF' +,p_enable_mail_download=>true +,p_fixed_header=>'PAGE' +,p_show_icon_view=>false +,p_show_detail_view=>false +,p_javascript_code=>wwv_flow_string.join(wwv_flow_t_varchar2( +'function(config) {', +' return unified_ig_toolbar(config, '''');', +'}', +'')) +); +wwv_flow_api.create_ig_report( + p_id=>wwv_flow_api.id(15343081152759599) +,p_interactive_grid_id=>wwv_flow_api.id(15126630885615749) +,p_static_id=>'153431' +,p_type=>'PRIMARY' +,p_default_view=>'GRID' +,p_rows_per_page=>50 +,p_show_row_number=>false +,p_settings_area_expanded=>true +); +wwv_flow_api.create_ig_report_view( + p_id=>wwv_flow_api.id(15343279857759599) +,p_report_id=>wwv_flow_api.id(15343081152759599) +,p_view_type=>'GRID' +,p_stretch_columns=>true +,p_srv_exclude_null_values=>false +,p_srv_only_display_columns=>true +,p_edit_mode=>false +); +wwv_flow_api.create_ig_report_column( + p_id=>wwv_flow_api.id(15343710679759602) +,p_view_id=>wwv_flow_api.id(15343279857759599) +,p_display_seq=>0 +,p_column_id=>wwv_flow_api.id(15126794710615750) +,p_is_visible=>false +,p_is_frozen=>false +,p_sort_order=>1 +,p_sort_direction=>'ASC' +,p_sort_nulls=>'LAST' +); +wwv_flow_api.create_ig_report_column( + p_id=>wwv_flow_api.id(15344629051759606) +,p_view_id=>wwv_flow_api.id(15343279857759599) +,p_display_seq=>2 +,p_column_id=>wwv_flow_api.id(15336946122749801) +,p_is_visible=>true +,p_is_frozen=>false +,p_width=>60 +); +wwv_flow_api.create_ig_report_column( + p_id=>wwv_flow_api.id(15345545024759611) +,p_view_id=>wwv_flow_api.id(15343279857759599) +,p_display_seq=>3 +,p_column_id=>wwv_flow_api.id(15337027370749802) +,p_is_visible=>true +,p_is_frozen=>false +,p_sort_order=>2 +,p_sort_direction=>'ASC' +,p_sort_nulls=>'LAST' +); +wwv_flow_api.create_ig_report_column( + p_id=>wwv_flow_api.id(15346475959759614) +,p_view_id=>wwv_flow_api.id(15343279857759599) +,p_display_seq=>7 +,p_column_id=>wwv_flow_api.id(15337391876749805) +,p_is_visible=>true +,p_is_frozen=>false +,p_width=>90 +); +wwv_flow_api.create_ig_report_column( + p_id=>wwv_flow_api.id(15347316509759617) +,p_view_id=>wwv_flow_api.id(15343279857759599) +,p_display_seq=>8 +,p_column_id=>wwv_flow_api.id(15337406732749806) +,p_is_visible=>true +,p_is_frozen=>false +,p_width=>90 +); +wwv_flow_api.create_ig_report_column( + p_id=>wwv_flow_api.id(15365122217050978) +,p_view_id=>wwv_flow_api.id(15343279857759599) +,p_display_seq=>3 +,p_column_id=>wwv_flow_api.id(15337584912749807) +,p_is_visible=>true +,p_is_frozen=>false +); +wwv_flow_api.create_ig_report_column( + p_id=>wwv_flow_api.id(15366065794050982) +,p_view_id=>wwv_flow_api.id(15343279857759599) +,p_display_seq=>4 +,p_column_id=>wwv_flow_api.id(15337687266749808) +,p_is_visible=>true +,p_is_frozen=>false +); +wwv_flow_api.create_ig_report_column( + p_id=>wwv_flow_api.id(15366944313050984) +,p_view_id=>wwv_flow_api.id(15343279857759599) +,p_display_seq=>5 +,p_column_id=>wwv_flow_api.id(15337780023749809) +,p_is_visible=>true +,p_is_frozen=>false +); +wwv_flow_api.create_ig_report_column( + p_id=>wwv_flow_api.id(15367819890050986) +,p_view_id=>wwv_flow_api.id(15343279857759599) +,p_display_seq=>6 +,p_column_id=>wwv_flow_api.id(15337831598749810) +,p_is_visible=>false +,p_is_frozen=>false +); +wwv_flow_api.create_ig_report_column( + p_id=>wwv_flow_api.id(15368758486050988) +,p_view_id=>wwv_flow_api.id(15343279857759599) +,p_display_seq=>9 +,p_column_id=>wwv_flow_api.id(15337955174749811) +,p_is_visible=>true +,p_is_frozen=>false +,p_width=>90 +); +wwv_flow_api.create_ig_report_column( + p_id=>wwv_flow_api.id(15369635886050990) +,p_view_id=>wwv_flow_api.id(15343279857759599) +,p_display_seq=>10 +,p_column_id=>wwv_flow_api.id(15338093819749812) +,p_is_visible=>true +,p_is_frozen=>false +,p_width=>160 +); wwv_flow_api.create_page_plug( p_id=>wwv_flow_api.id(35088434106539076) ,p_plug_name=>'Tables [GRID]' @@ -564,6 +1127,18 @@ wwv_flow_api.create_region_column( ,p_is_primary_key=>false ,p_include_in_export=>true ); +wwv_flow_api.component_end; +end; +/ +begin +wwv_flow_api.component_begin ( + p_version_yyyy_mm_dd=>'2021.04.15' +,p_release=>'21.1.6' +,p_default_workspace_id=>9014660246496943 +,p_default_application_id=>770 +,p_default_id_offset=>0 +,p_default_owner=>'CORE' +); wwv_flow_api.create_region_column( p_id=>wwv_flow_api.id(54275218278794475) ,p_name=>'LAST_DDL_TIME' @@ -1127,18 +1702,6 @@ wwv_flow_api.create_region_column( ,p_is_primary_key=>false ,p_include_in_export=>true ); -wwv_flow_api.component_end; -end; -/ -begin -wwv_flow_api.component_begin ( - p_version_yyyy_mm_dd=>'2021.04.15' -,p_release=>'21.1.6' -,p_default_workspace_id=>9014660246496943 -,p_default_application_id=>770 -,p_default_id_offset=>0 -,p_default_owner=>'CORE' -); wwv_flow_api.create_region_column( p_id=>wwv_flow_api.id(36660740650288408) ,p_name=>'COLUMN_NAME' @@ -1706,6 +2269,18 @@ wwv_flow_api.create_region_column( ,p_duplicate_value=>true ,p_include_in_export=>true ); +wwv_flow_api.component_end; +end; +/ +begin +wwv_flow_api.component_begin ( + p_version_yyyy_mm_dd=>'2021.04.15' +,p_release=>'21.1.6' +,p_default_workspace_id=>9014660246496943 +,p_default_application_id=>770 +,p_default_id_offset=>0 +,p_default_owner=>'CORE' +); wwv_flow_api.create_region_column( p_id=>wwv_flow_api.id(36931850621556199) ,p_name=>'HIGH_VALUE' @@ -2241,18 +2816,6 @@ wwv_flow_api.create_page_button( ,p_button_condition_type=>'VAL_OF_ITEM_IN_COND_EQ_COND2' ,p_icon_css_classes=>'fa-lock' ); -wwv_flow_api.component_end; -end; -/ -begin -wwv_flow_api.component_begin ( - p_version_yyyy_mm_dd=>'2021.04.15' -,p_release=>'21.1.6' -,p_default_workspace_id=>9014660246496943 -,p_default_application_id=>770 -,p_default_id_offset=>0 -,p_default_owner=>'CORE' -); wwv_flow_api.create_page_button( p_id=>wwv_flow_api.id(14450591044097210) ,p_button_sequence=>60 @@ -2392,9 +2955,24 @@ wwv_flow_api.create_page_item( ,p_attribute_01=>'Y' ); wwv_flow_api.create_page_process( - p_id=>wwv_flow_api.id(14473367182097228) + p_id=>wwv_flow_api.id(15126036055615743) ,p_process_sequence=>10 ,p_process_point=>'AFTER_SUBMIT' +,p_region_id=>wwv_flow_api.id(35088434106539076) +,p_process_type=>'NATIVE_IG_DML' +,p_process_name=>'SAVE_TABLES' +,p_attribute_01=>'PLSQL_CODE' +,p_attribute_04=>wwv_flow_string.join(wwv_flow_t_varchar2( +'NULL;', +'')) +,p_attribute_05=>'Y' +,p_attribute_06=>'N' +,p_error_display_location=>'INLINE_IN_NOTIFICATION' +); +wwv_flow_api.create_page_process( + p_id=>wwv_flow_api.id(14473367182097228) +,p_process_sequence=>20 +,p_process_point=>'AFTER_SUBMIT' ,p_region_id=>wwv_flow_api.id(36931436636556194) ,p_process_type=>'NATIVE_IG_DML' ,p_process_name=>'SAVE_PARTITIONS' @@ -2425,7 +3003,7 @@ wwv_flow_api.create_page_process( ); wwv_flow_api.create_page_process( p_id=>wwv_flow_api.id(15125792413615740) -,p_process_sequence=>20 +,p_process_sequence=>30 ,p_process_point=>'AFTER_SUBMIT' ,p_region_id=>wwv_flow_api.id(36660462504288405) ,p_process_type=>'NATIVE_IG_DML' @@ -2439,19 +3017,6 @@ wwv_flow_api.create_page_process( ,p_attribute_06=>'N' ,p_error_display_location=>'INLINE_IN_NOTIFICATION' ); -wwv_flow_api.create_page_process( - p_id=>wwv_flow_api.id(15126036055615743) -,p_process_sequence=>30 -,p_process_point=>'AFTER_SUBMIT' -,p_region_id=>wwv_flow_api.id(35088434106539076) -,p_process_type=>'NATIVE_IG_DML' -,p_process_name=>'Tables [GRID] - Save Interactive Grid Data' -,p_attribute_01=>'REGION_SOURCE' -,p_attribute_05=>'Y' -,p_attribute_06=>'Y' -,p_attribute_08=>'Y' -,p_error_display_location=>'INLINE_IN_NOTIFICATION' -); wwv_flow_api.create_page_process( p_id=>wwv_flow_api.id(14473706325097229) ,p_process_sequence=>10 diff --git a/views/obj_constraints.sql b/views/obj_constraints.sql new file mode 100644 index 0000000..5643094 --- /dev/null +++ b/views/obj_constraints.sql @@ -0,0 +1,67 @@ +CREATE OR REPLACE VIEW obj_constraints AS +WITH x AS ( + SELECT + app.get_item('$TABLE_NAME') AS table_name + FROM users u + WHERE u.user_id = app.get_user_id() +), +p AS ( + SELECT + n.table_name, + n.constraint_name, + k.table_name AS primary_table, + LISTAGG(p.column_name, ', ') WITHIN GROUP (ORDER BY p.position) AS primary_cols, + n.r_constraint_name AS primary_constraint + FROM user_constraints n + JOIN x + ON n.table_name = NVL(x.table_name, n.table_name) + JOIN user_cons_columns c + ON c.constraint_name = n.constraint_name + JOIN user_cons_columns p + ON p.constraint_name = n.r_constraint_name + AND p.position = c.position + JOIN user_constraints k + ON k.constraint_name = n.r_constraint_name + WHERE n.constraint_type = 'R' + GROUP BY n.table_name, n.constraint_name, k.table_name, n.r_constraint_name +), +c AS ( + SELECT + n.table_name, + n.constraint_name, + n.constraint_type, + -- + LISTAGG(c.column_name, ', ') WITHIN GROUP (ORDER BY c.position) AS cols, + -- + MAX(CASE WHEN n.generated = 'GENERATED NAME' THEN 'Y' END) AS is_generated, + MAX(CASE WHEN n.status = 'DISABLED' THEN 'Y' END) AS is_disabled, + MAX(CASE WHEN n.deferrable = 'DEFERRABLE' THEN 'Y' END) AS is_deferred, + -- + MAX(n.delete_rule) AS delete_rule + FROM user_constraints n + JOIN x + ON n.table_name = NVL(x.table_name, n.table_name) + JOIN user_cons_columns c + ON c.constraint_name = n.constraint_name + WHERE n.table_name NOT IN (SELECT object_name FROM RECYCLEBIN) + GROUP BY n.table_name, n.constraint_name, n.constraint_type +) +SELECT + c.table_name, + c.constraint_name, + c.constraint_type, + c.cols, + -- + p.primary_table, + p.primary_cols, + p.primary_constraint, + -- + c.is_generated, + c.is_disabled, + c.is_deferred, + c.delete_rule +FROM c +LEFT JOIN p + ON p.table_name = c.table_name + AND p.constraint_name = c.constraint_name; +