DBA Data[Home] [Help]

APPS.JTF_DIAGNOSTIC_COREAPI SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 42

procedure Insert_Style_Sheet_html is
styleSheet varchar2(5000);
Line: 123

procedure Insert_HTML_html(p_text varchar2) is
begin
   line_out(p_text);
Line: 126

end Insert_HTML_html;
Line: 506

  select   a.name sobname,
           count(b.period_name) total_periods,
           count(decode(b.closing_status,'O',b.PERIOD_NAME,null)) open_periods,
           a.accounted_period_type period_type
  from     gl_sets_of_books a,
           gl_period_statuses b
  where    a.set_of_books_id = b.set_of_books_id (+)
  and      b.application_id = p_appId
  and      a.set_of_books_id = p_sobId
  and      b.period_type = a.accounted_period_type
  group by a.name, a.accounted_period_type;
Line: 523

select application_name
into   l_appname
from   fnd_application_vl
where  application_id = p_appid ;
Line: 534

select user_period_type into l_user_period_type
from   gl_period_types
where  period_type = c1_rec.period_type;
Line: 552

    SELECT  period_name, start_date, end_date, sysdate
    INTO    l_period_name, l_start_date, l_end_date, l_sysdate
    FROM gl_period_statuses
    WHERE adjustment_period_flag = 'N'
    AND   period_type = c1_rec.period_type
    AND   start_date = (
      SELECT MAX(start_date)
      FROM gl_period_statuses
      WHERE  closing_status = 'O'
      AND    adjustment_period_flag = 'N'
      AND    period_type = c1_rec.period_type
      AND    application_id = p_appId
      AND    set_of_books_id = p_sobId )
    AND closing_status  = 'O'
    AND application_id  =  p_appId
    AND set_of_books_id = p_sobId;
Line: 582

        SELECT period_name, start_date, end_date, sysdate
        INTO   l_period_name, l_start_date, l_end_date, l_sysdate
        FROM   gl_period_statuses
        WHERE  adjustment_period_flag = 'N'
        AND    period_type = c1_rec.period_type
        AND    sysdate between start_date and end_date
        AND    closing_status = 'O'
        AND    application_id = p_appId
        AND    set_of_books_id = p_sobId;
Line: 694

  select id_flex_num                   flex_str_num,
         id_flex_structure_name        flex_str_name,
         to_char(last_update_date,'MM-DD-YYYY HH24:MI:SS') last_updated,
         cross_segment_validation_flag cross_val,
         dynamic_inserts_allowed_flag  dyn_insert,
         enabled_flag                  enabled,
         freeze_flex_definition_flag   frozen
  from   fnd_id_flex_structures_vl
  where  id_flex_code = p_f_code
  and    enabled_flag ='Y'
  and    id_flex_num = nvl(p_f_num,id_flex_num);
Line: 707

  select s.application_column_name          col_name,
         s.segment_name                     seg_name,
         s.segment_num                      seg_num,
         s.enabled_flag                     enabled,
         s.required_flag                    required,
         s.display_flag                     displayed,
         s.flex_value_set_id                value_set_id,
         vs.flex_value_set_name             value_set_name,
         DECODE(vs.validation_type,
              'I', 'Independent', 'N', 'None',  'D', 'Dependent',
              'U', 'Special',     'P', 'Pair',  'F', 'Table',
              'X', 'Translatable Independent',  'Y', 'Translatable Dependent',
              vs.validation_type)           validation_type,
         s.security_enabled_flag            seg_security,
         nvl(vs.security_enabled_flag,'N')  value_set_security
  from   fnd_id_flex_segments_vl s, fnd_flex_value_sets vs
  where  s.flex_value_set_id = vs.flex_value_set_id (+)
  and    s.id_flex_code = p_f_code
  and    s.id_flex_num =  p_f_num
  order by s.segment_num ;
Line: 729

  select segment_prompt
  from fnd_segment_attribute_values sav,
       fnd_segment_attribute_types  sat
  where sav.attribute_value = 'Y'
  and   sav.segment_attribute_type <> 'GL_GLOBAL'
  and   sav.application_id = sat.application_id
  and   sav.id_flex_code = sat.id_flex_code
  and   sav.segment_attribute_type = sat.segment_attribute_type
  and   sav.id_flex_code = p_f_code
  and   sav.id_flex_num =  p_f_num
  and   sav.application_column_name = p_col_name;
Line: 743

    select id_flex_name into l_flex_name
    from   fnd_id_flexs
    where id_flex_code = p_flex_code;
Line: 776

      l_ret_array(4) := str.dyn_insert;
Line: 783

      ||', Dynamic Inserts = '||str.dyn_insert||', Cross Validation Allowed = '
      ||str.cross_val||', Last Updated '||str.last_updated);
Line: 825

        select count(*) into l_rule_count
        from   fnd_flex_value_rules_vl
        where  flex_value_set_id = seg.value_set_id;
Line: 829

        select count(*) into l_rule_assign_count
        from   fnd_flex_value_rules_vl r,
               fnd_flex_value_rule_usages ru
        where  r.flex_value_rule_id = ru.flex_value_rule_id
        and    r.flex_value_set_id =  seg.value_set_id;
Line: 945

      select user_profile_option_name,
             nvl(start_date_active,sysdate-1),
             nvl(end_date_active,sysdate+1)
      into   l_user_prof_name, l_start_date, l_end_date
      from   fnd_profile_options_vl
      where  profile_option_name = p_prof_name;
Line: 1045

  select count(*) into l_counter
  from   all_tab_columns z
  where  z.table_name = upper(p_tab)
  and    z.column_name = upper(p_col)
  and 	 upper(z.owner) = upper(p_owner);
Line: 1272

      select value into l_hold_date_format
      from   nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
Line: 1281

      hold_sql := 'select ';
Line: 1368

		 atleast one row and it will pirnt header only if rows are selected
	        */
               if hideHeader = TRUE then
                  line_out('
' || temp || '');
Line: 1426

		      '0 Rows Selected
';
Line: 1430

              '1 Row Selected
';
Line: 1434

              ' Rows Selected
';
Line: 1614

   dummy := Display_SQL ('select * from ' ||
      replace(upper(p_table_name),'V_$','V$') || l_newline || p_where_clause ||
      hold_char || nvl(p_order_by_clause,'order by 1')
      , nvl(p_table_alias, p_table_name)
      , p_display_longs);
Line: 1656

   return(Display_SQL ('select * from ' ||
      replace(upper(p_table_name),'V_$','V$') || l_newline || p_where_clause ||
      l_newline || nvl(p_order_by_clause,'order by 1')
      , nvl(p_table_alias, p_table_name)
      , p_display_longs));
Line: 1683

   select release_name into l_appsver from fnd_product_groups;
Line: 1711

   select instance_name
             , host_name
             , version
          into l_instance_name
             , l_host_name
             , l_version
          from v$instance;
Line: 1718

   Insert_Style_Sheet;
Line: 1858

   select substr(z.text, instr(z.text,'$Header')+10, 40)
     into hold_version
     from all_source z
    where z.name = p_package
      and z.type = p_type
      and z.owner = p_schema
      and z.text like '%$Header%';
Line: 1934

      'select b.USER_PROFILE_OPTION_NAME "Long
Name"' || ' , a.profile_option_name "Short
Name"' || ' , decode(to_char(c.level_id),''10001'',''Site''' || ' ,''10002'',''Application''' || ' ,''10003'',''Responsibility''' || ' ,''10004'',''User''' || ' ,''Unknown'') "Level"' || ' , decode(to_char(c.level_id),''10001'',''Site''' || ' ,''10002'',nvl(h.application_short_name,to_char(c.level_value))' || ' ,''10003'',nvl(g.responsibility_name,to_char(c.level_value))' || ' ,''10004'',nvl(e.user_name,to_char(c.level_value))' || ' ,''Unknown'') "Level
Value"' || ' , c.PROFILE_OPTION_VALUE "Profile
Value"' || ' , c.profile_option_id "Profile
ID"' || ' , to_char(c.LAST_UPDATE_DATE,''MM-DD-YYYY HH24:MI'') ' || ' "Updated
Date"' || ' , nvl(d.user_name,to_char(c.last_updated_by)) "Updated
By"' || ' from fnd_profile_options a' || ' , FND_PROFILE_OPTIONS_TL b' || ' , FND_PROFILE_OPTION_VALUES c' || ' , FND_USER d' || ' , FND_USER e' || ' , FND_RESPONSIBILITY_TL g' || ' , FND_APPLICATION h' || ' where a.application_id = nvl(' || nvl(p_application_id,'null') || ' , a.application_id)' || ' and a.profile_option_name = nvl(''' || p_short_name || ''' , a.profile_option_name)' || ' and a.profile_option_name = b.profile_option_name' || ' and a.profile_option_id = c.profile_option_id' || ' and a.application_id = c.application_id' || ' and c.last_updated_by = d.user_id (+)' || ' and c.level_value = e.user_id (+)' || ' and c.level_value = g.responsibility_id (+)' || ' and c.level_value = h.application_id (+)' || ' and b.language = ''US''' || ' order by 1, 4, 5');
Line: 2067

    select user_id into l_user_id
    from fnd_user where user_name = l_user_name;
Line: 2075

    sqltxt := 'select rg.application_id '||
              'from   fnd_user_responsibility rg '||
              'where  rg.responsibility_id = '||to_char(p_resp_id)||' '||
              'and    rg.user_id = '||to_char(l_user_id);
Line: 2080

    sqltxt := 'select rg.responsibility_application_id '||
              'from   fnd_user_resp_groups rg '||
              'where  rg.responsibility_id = '||to_char(p_resp_id)||' '||
              'and    rg.user_id = '||to_char(l_user_id);
Line: 2237

   select count(*) into l_counter
     from all_tables z
    where z.table_name = 'AD_BUGS'
    and upper(z.owner) = 'APPLSYS';
Line: 2243

      l_sqltxt := 'select application_short_name'
         || '     , bug_number'
         || '     , creation_date'
         || ' from ad_bugs'
         || ' where upper(application_short_name) like '''
         ||     upper(p_app_short_name)
         || '''   and creation_date >= '''
         ||     nvl(to_char(p_start_date,'MM-DD-YYYY'),olddate)
         || '''   and bug_number like '''||p_bug_number||'''';
Line: 2281

      select name
        into l_hold_name
        from v$database;
Line: 2289

      select banner
        into l_DB_Ver
        from v$version
       where banner like 'Oracle%';
Line: 2347

select o.object_name, o.object_type, o.owner
from   all_objects o
where  o.status = 'INVALID'
and    o.object_name like c_start_string escape '~'
and    upper(o.owner) in ('APPS', 'JTF', 'APPLSYS')
order by o.object_name;
Line: 2358

select substr(substr(s.text,instr(s.text,'$Header')+9),1,
          instr(substr(s.text,instr(s.text,'$Header')+9),' ',1,2)-1) file_vers
from   all_source s
where  s.name = c_obj_name
and    s.type = c_obj_type
and    s.owner = c_obj_owner
and    s.text like '%$Header%';
Line: 2370

select to_char(sequence)||') LINE: '||to_char(line)||' CHR: '||
          to_char(position)||'  '||text error_row
from   all_errors z
where  z.name = c_obj_name
and    z.type = c_obj_type
and    z.owner = c_obj_owner;
Line: 2428

      Insert_HTML('
No Rows Selected
');
Line: 2611

  select count(*) into l_counter
  from   all_tab_columns z
  where  z.table_name = upper(p_tab)
  and    z.column_name = upper(p_col)
  and 	 upper(z.owner) = upper(p_owner);
Line: 2721

  select   a.name sobname,
           count(b.period_name) total_periods,
           count(decode(b.closing_status,'O',b.PERIOD_NAME,null)) open_periods,
           a.accounted_period_type period_type
  from     gl_sets_of_books a,
           gl_period_statuses b
  where    a.set_of_books_id = b.set_of_books_id (+)
  and      b.application_id = p_appId
  and      a.set_of_books_id = p_sobId
  and      b.period_type = a.accounted_period_type
  group by a.name, a.accounted_period_type;
Line: 2738

select application_name
into   l_appname
from   fnd_application_vl
where  application_id = p_appid ;
Line: 2748

select user_period_type into l_user_period_type
from   gl_period_types
where  period_type = c1_rec.period_type;
Line: 2766

    SELECT  period_name, start_date, end_date, sysdate
    INTO    l_period_name, l_start_date, l_end_date, l_sysdate
    FROM gl_period_statuses
    WHERE adjustment_period_flag = 'N'
    AND   period_type = c1_rec.period_type
    AND   start_date = (
      SELECT MAX(start_date)
      FROM gl_period_statuses
      WHERE  closing_status = 'O'
      AND    adjustment_period_flag = 'N'
      AND    period_type = c1_rec.period_type
      AND    application_id = p_appId
      AND    set_of_books_id = p_sobId )
    AND closing_status  = 'O'
    AND application_id  =  p_appId
    AND set_of_books_id = p_sobId;
Line: 2797

        SELECT period_name, start_date, end_date, sysdate
        INTO   l_period_name, l_start_date, l_end_date, l_sysdate
        FROM   gl_period_statuses
        WHERE  adjustment_period_flag = 'N'
        AND    period_type = c1_rec.period_type
        AND    sysdate between start_date and end_date
        AND    closing_status = 'O'
        AND    application_id = p_appId
        AND    set_of_books_id = p_sobId;
Line: 2902

  select id_flex_num                   flex_str_num,
         id_flex_structure_name        flex_str_name,
         to_char(last_update_date,'MM-DD-YYYY HH24:MI:SS') last_updated,
         cross_segment_validation_flag cross_val,
         dynamic_inserts_allowed_flag  dyn_insert,
         enabled_flag                  enabled,
         freeze_flex_definition_flag   frozen
  from   fnd_id_flex_structures_vl
  where  id_flex_code = p_f_code
  and    enabled_flag ='Y'
  and    id_flex_num = nvl(p_f_num,id_flex_num);
Line: 2915

  select s.application_column_name          col_name,
         s.segment_name                     seg_name,
         s.segment_num                      seg_num,
         s.enabled_flag                     enabled,
         s.required_flag                    required,
         s.display_flag                     displayed,
         s.flex_value_set_id                value_set_id,
         vs.flex_value_set_name             value_set_name,
         DECODE(vs.validation_type,
              'I', 'Independent', 'N', 'None',  'D', 'Dependent',
              'U', 'Special',     'P', 'Pair',  'F', 'Table',
              'X', 'Translatable Independent',  'Y', 'Translatable Dependent',
              vs.validation_type)           validation_type,
         s.security_enabled_flag            seg_security,
         nvl(vs.security_enabled_flag,'N')  value_set_security
  from   fnd_id_flex_segments_vl s, fnd_flex_value_sets vs
  where  s.flex_value_set_id = vs.flex_value_set_id (+)
  and    s.id_flex_code = p_f_code
  and    s.id_flex_num =  p_f_num
  order by s.segment_num ;
Line: 2937

  select segment_prompt
  from fnd_segment_attribute_values sav,
       fnd_segment_attribute_types  sat
  where sav.attribute_value = 'Y'
  and   sav.segment_attribute_type <> 'GL_GLOBAL'
  and   sav.application_id = sat.application_id
  and   sav.id_flex_code = sat.id_flex_code
  and   sav.segment_attribute_type = sat.segment_attribute_type
  and   sav.id_flex_code = p_f_code
  and   sav.id_flex_num =  p_f_num
  and   sav.application_column_name = p_col_name;
Line: 2951

    select id_flex_name into l_flex_name
    from   fnd_id_flexs
    where id_flex_code = p_flex_code;
Line: 2984

      l_ret_array(4) := str.dyn_insert;
Line: 2992

    Tab1Print('Dynamic Inserts          = '||str.dyn_insert);
Line: 2994

    Tab1Print('Last Updated Date        = '||str.last_updated);
Line: 3042

        select count(*) into l_rule_count
        from   fnd_flex_value_rules_vl
        where  flex_value_set_id = seg.value_set_id;
Line: 3046

        select count(*) into l_rule_assign_count
        from   fnd_flex_value_rules_vl r,
               fnd_flex_value_rule_usages ru
        where  r.flex_value_rule_id = ru.flex_value_rule_id
        and    r.flex_value_set_id =  seg.value_set_id;
Line: 3153

      select user_profile_option_name,
             nvl(start_date_active,sysdate-1),
             nvl(end_date_active,sysdate+1)
      into   l_user_prof_name, l_start_date, l_end_date
      from   fnd_profile_options_vl
      where  profile_option_name = p_prof_name;
Line: 3376

      'column of the SQL select statement');
Line: 3385

      '(which can be null) must be passed for every column of the select');
Line: 3476

    line_out(to_char(l_row_counter)||' rows selected');
Line: 3732

   Displays the output of the 'select * from table' as an HTML table.
 Examples:
   begin
      Display_Table('AR_SYSTEM_PARAMETERS_ALL', 'AR Parameters',
         'Where Org_id <> -3113'
                         , 'order by org_id, set_of_books_id', 'N');
Line: 3751

   dummy := Display_SQL ('select * from ' || replace(upper(p_table_name),'V_$','V$') || l_newline || p_where_clause || hold_char || nvl(p_order_by_clause,'order by 1')
          , nvl(p_table_alias, p_table_name)
          , p_display_longs);
Line: 3768

   Displays the output of the 'select * from table' as an HTML table.
 Returns:
   Number of rows displayed.
 Examples:
   declare
      num_rows   number;
Line: 3786

   return(Display_SQL ('select * from ' || replace(upper(p_table_name),'V_$','V$') || l_newline || p_where_clause || l_newline || nvl(p_order_by_clause,'order by 1')
          , nvl(p_table_alias, p_table_name)
          , p_display_longs));
Line: 3813

   select release_name into l_appsver from fnd_product_groups;
Line: 3841

  select instance_name, host_name, version
  into l_instance_name, l_host_name, l_version
  from v$instance;
Line: 3846

    select upper(value) into l_language
    from  v$parameter
    where  name = 'nls_language';
Line: 3860

      select name into l_org_name
      from   hr_all_organization_units
      where  organization_id = g_org_id;
Line: 3966

  select substr(z.text, instr(z.text,'$Header')+10, 40)
    into hold_version
    from all_source z
   where z.name = p_package
     and z.type = p_type
     and z.owner = p_schema
     and z.text like '%$Header%';
Line: 4048

select substr(ot.user_profile_option_name,1,45) user_profile_option_name,
       substr(o.profile_option_name,1,30) profile_option_name,
       decode(v.level_id,10001, 'Site',  10002, 'Appl',
                       10003, 'Resp',
                       10004, 'User') lev,
       substr(decode(v.level_id,
                       10001, ' ',
                       10002, a.application_name,
                       10003, r.responsibility_name,
                       10004, u.user_name),1,20) lev_value,
       v.profile_option_value opt_value
from fnd_profile_option_values v,
     fnd_profile_options o,
     fnd_profile_options_tl ot,
     fnd_application_tl a,
     fnd_responsibility_tl r,
     fnd_user u
where  o.application_id = nvl(p_application_id, o.application_id)
and    o.profile_option_name = nvl(p_short_name, o.profile_option_name)
and    v.LEVEL_VALUE =
           decode(level_id, 10004, u.user_id, 10003, r.responsibility_id,
                                      10002, a.application_id,10001,0)
and v.profile_option_id = o.profile_option_id
and v.application_id = o.application_id
and a.application_id (+) = v.level_value
and r.responsibility_id (+) = v.level_value
and u.user_id (+) = v.level_value
and ot.profile_option_name = o.profile_option_name
and nvl(ot.language,'US') = nvl(USERENV('LANG'),'US')
and sysdate between nvl(o.start_date_active, sysdate) and
    nvl(o.end_date_active,sysdate)
and v.profile_option_value is not null
order by ot.user_profile_option_name, v.level_id,
         decode(level_id,10001, 'Site',  10002, a.application_name, 10003,
              r.responsibility_name, 10004, u.user_name);
Line: 4089

  select max(length(substr(ot.user_profile_option_name,1,45))) max_u_length,
         max(length(substr(o.profile_option_name,1,30)))       max_length,
         max(length(decode(v.level_id,10001, 'Site',  10002, 'Appl',
                       10003, 'Resp',
                       10004, 'User'))),
         max(length(substr(decode(v.level_id,
                       10001, ' ',
                       10002, a.application_name,
                       10003, r.responsibility_name,
                       10004, u.user_name),1,20))),
         max(length(v.profile_option_value))
  into   max_user_opt, max_opt, max_lev, max_lev_value, max_opt_value
  from fnd_profile_option_values v,
       fnd_profile_options o,
       fnd_profile_options_tl ot,
       fnd_application_tl a,
       fnd_responsibility_tl r,
       fnd_user u
  where  o.application_id = nvl(p_application_id, o.application_id)
  and    o.profile_option_name = nvl(p_short_name, o.profile_option_name)
  and    v.LEVEL_VALUE =
             decode(level_id, 10004, u.user_id, 10003, r.responsibility_id,
                                      10002, a.application_id,10001,0)
  and v.profile_option_id = o.profile_option_id
  and v.application_id = o.application_id
  and a.application_id (+) = v.level_value
  and r.responsibility_id (+) = v.level_value
  and u.user_id (+) = v.level_value
  and ot.profile_option_name = o.profile_option_name
  and nvl(ot.language,'US') = nvl(USERENV('LANG'),'US')
  and sysdate between nvl(o.start_date_active, sysdate) and
      nvl(o.end_date_active,sysdate)
  and v.profile_option_value is not null;
Line: 4234

    select user_id into l_user_id
    from fnd_user where user_name = l_user_name;
Line: 4242

    sqltxt := 'select rg.application_id '||
              'from   fnd_user_responsibility rg '||
              'where  rg.responsibility_id = '||to_char(p_resp_id)||' '||
              'and    rg.user_id = '||to_char(l_user_id);
Line: 4247

    sqltxt := 'select rg.responsibility_application_id '||
              'from   fnd_user_resp_groups rg '||
              'where  rg.responsibility_id = '||to_char(p_resp_id)||' '||
              'and    rg.user_id = '||to_char(l_user_id);
Line: 4399

    select count(*) into l_counter from all_tables z
    where  z.table_name = 'AD_BUGS'
    and z.owner = 'APPLSYS';
Line: 4413

      sqltxt := 'select bug_number, creation_date, application_short_name ' ||
                'from ad_bugs '||
                'where upper(application_short_name) like '''||
                 p_app_short_name||''''||
                'and bug_number like '''||p_bug_number||''''||
                'and creation_date >= nvl(to_date('''||
                   to_char(p_start_date,'MM-DD-YYYY')||
                ''',''MM-DD-YYYY''),creation_date)';
Line: 4450

      select name
        into l_hold_name
        from v$database;
Line: 4458

      select banner
        into l_DB_Ver
        from v$version
       where banner like 'Oracle%';
Line: 4521

    select z.text into vers_line
    from   dba_source z
    where  z.name = package_name
    and    z.owner = l_object_owner
    and    z.text like '%$Header%'
    and    z.type = 'PACKAGE BODY';
Line: 4528

    select z.text into vers_line
    from   dba_source z
    where  z.name = package_name
    and    z.owner = l_object_owner
    and    z.text like '%$Header%'
    and    z.type = 'PACKAGE';
Line: 4615

select o.object_name, o.object_type, o.owner
from   all_objects o
where  o.status = 'INVALID'
and    o.object_name like c_start_string escape '~'
and    upper(o.owner) in ('APPS', 'JTF', 'APPLSYS')
order by o.object_name;
Line: 4626

select substr(substr(s.text,instr(s.text,'$Header')+9),1,
          instr(substr(s.text,instr(s.text,'$Header')+9),' ',1,2)-1) file_vers
from   all_source s
where  name = c_obj_name
and    type = c_obj_type
and    owner = c_obj_owner
and    text like '%$Header%';
Line: 4638

select to_char(z.sequence)||') LINE: '||to_char(z.line)||' CHR: '||
          to_char(z.position)||'  '||text error_row
from   all_errors z
where  z.name = c_obj_name
and    z.type = c_obj_type
and    z.owner = c_obj_owner;
Line: 4698

  Tab0Print(to_char(l_rows)||' rows selected');
Line: 4721

procedure Insert_Style_Sheet IS
BEGIN
  IF (JTF_DIAGNOSTIC_ADAPTUTIL.b_html_on) THEN
   Insert_Style_Sheet_html;
Line: 4732

procedure Insert_HTML(p_text varchar2) IS
BEGIN
  IF (JTF_DIAGNOSTIC_ADAPTUTIL.b_html_on) THEN
   Insert_HTML_html(p_text);
Line: 5616

  select oracle_username into apps_schema_name from fnd_oracle_userid where read_only_flag='U';