DBA Data[Home] [Help]

APPS.HR_DM_GEN_TUPS SQL Statements

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

Line: 26

type t_delete_dml is record
(
  where_clause                 varchar2(32767),
  call_to_proc                 varchar2(32767),
  proc_parameters              varchar2(32767)
);
Line: 47

g_delete_dml                  t_delete_dml;
Line: 100

   g_exception_tbl.delete;
Line: 123

    g_package_body.delete(l_index);
Line: 132

    g_resolve_pk_columns_tbl.delete(l_index);
Line: 645

              'select ' || l_parent_id_column_name || indent(4) ||
              'from ' || l_parent_table_name ||
              indent(4) || 'where ' || rtrim(l_where_clause) || ';';
Line: 762

procedure prepare_ins_dt_delete_stmt
(
  p_table_info       in        hr_dm_gen_main.t_table_info,
  p_proc_body        in out nocopy    varchar2 ,
  p_ins_type         in        varchar2 default 'P',
  p_indent           in        number
)
is
 l_table_name  varchar2(30) := upper(p_table_info.upload_table_name);
Line: 772

  hr_dm_utility.message('ROUT','entry:hr_dm_gen_tups.prepare_ins_dt_delete_stmt ', 5);
Line: 776

    'hr_dm_library.ins_dt_delete (p_id          => ' || 'p_' ||
     rpad(g_pk_columns_tbl(1),28) ||',' ||indent(p_indent + 29) ||
     'p_table_name  => '''|| l_table_name || ''','  ||
     indent(p_indent + 29) || 'p_ins_type    => ''' || p_ins_type ||
     ''');' ;
Line: 783

   'hr_dm_library.ins_dt_delete ( p_table_name  => '''|| l_table_name
    || ''''  ||  indent(p_indent + 29) || ',p_ins_type    => ''' ||
    p_ins_type || '''' ;
Line: 815

  hr_dm_utility.message('ROUT','exit:hr_dm_gen_tups.prepare_ins_dt_delete_stmt',
                         25);
Line: 819

     hr_dm_utility.error(SQLCODE,'hr_dm_gen_tups.prepare_ins_dt_delete_stmt',
                         '(none)','R');
Line: 822

end prepare_ins_dt_delete_stmt;
Line: 836

procedure prepare_chk_dt_delete_stmt
(
  p_table_info       in        hr_dm_gen_main.t_table_info,
  p_proc_body        in out nocopy    varchar2 ,
  p_indent           in        number
)
is
 l_proc_name   varchar2(30) ;
Line: 846

  hr_dm_utility.message('ROUT','entry:hr_dm_gen_tups.prepare_chk_dt_delete_stmt ', 5);
Line: 850

       'hr_dm_library.chk_row_in_dt_delete (p_id          => p_' ||
       rpad(g_pk_columns_tbl(1),28) ||',' ||indent(p_indent + 30) ||
      'p_table_name  => '''|| l_table_name || ''','  ||
      indent(p_indent + 30) || 'p_ins_type    => l_ins_type,' ||
      indent(p_indent + 30) || 'p_row_exists  => l_row_exists);';
Line: 858

    l_proc_name := 'chk_row_in_dt_delete_' || to_char(g_no_of_pk_columns) ||
                   '_pkcol' ;
Line: 895

  hr_dm_utility.message('ROUT','exit:hr_dm_gen_tups.prepare_chk_dt_delete_stmt',
                         25);
Line: 899

     hr_dm_utility.error(SQLCODE,'hr_dm_gen_tups.prepare_chk_dt_delete_stmt',
                         '(none)','R');
Line: 902

end prepare_chk_dt_delete_stmt;
Line: 976

      ' row is inserted if a logical record does not exist (excluding the logical'
      || ' record created by other slave processes). if logical record exists  for'
      || ' a Application data type migration, then logical record is deleted from '
      || ' destination and a record is created into ' ||
      'dt_delete table with type ''D'' (so as other physical records for this ' ||
      'logical record will skip this check) and will upload the ' ||
      'data. If logical record exists  for'
      || ' any other type of data migration then  a record is created into ' ||
      'dt_delete table with type ''P''.', l_indent)  || indent;
Line: 997

       ' row is inserted if a logical record does not exist (excluding the logical'
       || ' record created by other slave processes). if logical record exists  for'
       || ' a Application data type migration, then logical record is deleted from '
       || ' destination and a record is created into ' ||
       'dt_delete table with type ''D'' (so as other physical records for this ' ||
       'logical record will skip this check) and will upload the ' ||
       'data. If logical record exists  for'
       || ' any other type of data migration then a record is created into ' ||
       'dt_delete table with type ''P''.', l_indent)  || indent;
Line: 1018

    ' row is inserted if a logical record does not exist (excluding the logical'
    || ' record created by other slave processes). if logical record exists  for'
    || ' a Application data type migration, then logical record is deleted from '
    || ' destination and a record is created into ' ||
    'dt_delete table with type ''D'' (so as other physical records for this ' ||
    'logical record will skip this check) and will upload the ' ||
    'data. If logical record exists  for'
    || ' any other type of data migration then a record is created into ' ||
    'dt_delete table with type ''P''.', l_indent)  || indent;
Line: 1052

  indent(l_indent + 2) || 'l_insert := TRUE;' || indent(l_indent) || 'else' ||
Line: 1059

  'Find out nocopy if the row already exists for this id in the dt_deletes table '||
  'in the database or not.',
  p_indent_spaces    => l_indent) || indent;
Line: 1071

  prepare_chk_dt_delete_stmt
  ( p_table_info  => p_table_info,
    p_proc_body   => l_proc_body,
    p_indent      => l_indent);
Line: 1081

  '''D'' then ' || indent(l_indent + 4) ||  'l_insert := TRUE;' ||
Line: 1083

   ||  'l_insert := FALSE;' || indent(l_indent + 2) || 'end if; -- l_row_exists'
Line: 1131

   format_comment('create a row into dt_deletes table of type ''D'',so the' ||
  ' subsequent physical records can be uploaded without performing any ' ||
  'checks.',l_indent+2) || indent(l_indent + 2);
Line: 1137

     prepare_ins_dt_delete_stmt
     ( p_table_info  => p_table_info,
       p_proc_body   => l_proc_body,
       p_ins_type    => 'D',
       p_indent      => l_indent + 2);
Line: 1144

     'l_insert := TRUE;' || indent(l_indent) || 'else  -- row already exists' ||
Line: 1148

     'l_insert := FALSE;' || indent(l_indent) || 'else  -- row already exists' ||
Line: 1160

  format_comment('if migration_type is application then update the row',
   l_indent,'N') || indent(l_indent - 2);
Line: 1165

      prepare_ins_dt_delete_stmt
      ( p_table_info  => p_table_info,
        p_proc_body   => l_proc_body,
        p_ins_type    => 'P',
        p_indent      => l_indent);
Line: 1172

     'l_insert := FALSE;';
Line: 1175

     format_comment('create a row into dt_deletes table of type ''D'',so the' ||
     ' subsequent physical records can be uploaded without performing any ' ||
     'checks.',l_indent,'N') || indent(l_indent) ;
Line: 1180

      prepare_ins_dt_delete_stmt
      ( p_table_info  => p_table_info,
        p_proc_body   => l_proc_body,
        p_ins_type    => 'D',
        p_indent      => l_indent);
Line: 1187

      format_comment('call delete_dml procedure to delete all existing rows for' ||
      ' the given id',l_indent);
Line: 1193

         l_proc_body  := l_proc_body || indent(l_indent) || g_delete_dml.call_to_proc;
Line: 1196

         'delete_dml( ' || hr_dm_library.conv_list_to_text(
                                              p_rpad_spaces    => l_indent + 11,
                                              p_pad_first_line => 'N',
                                              p_prefix_col     => 'p_',
                                              p_columns_tbl => g_pk_columns_tbl,
                                              p_col_length  => 28)  || ');';
Line: 1204

     'l_insert := TRUE;';
Line: 1216

     format_comment('create a row into dt_deletes table of type ''P'',so the' ||
     ' subsequent physical records can skip these checks and info will be used' ||
     'for reporting.',l_indent,'N') || indent(l_indent);
Line: 1221

     prepare_ins_dt_delete_stmt
     ( p_table_info  => p_table_info,
       p_proc_body   => l_proc_body,
       p_ins_type    => 'P',
       p_indent      => l_indent);
Line: 1227

     l_proc_body := l_proc_body ||  indent(l_indent) || 'l_insert := FALSE;' ||
Line: 1244

    indent(l_indent + 2) || 'l_insert := TRUE;' || indent(l_indent) ||
Line: 1339

      'inserted if it does not exist or updated if row exists for a Application' ||
      ' data type migration, otherwise, a record is created in DT_DELETES table.',
      l_indent)  || indent;
Line: 1351

      'inserted, if it does not exist or updated if row exists for a Application' ||
      ' or Full data type migration, otherwise,a record is created in DT_DELETES table.',
       l_indent) || indent;
Line: 1360

    'inserted, if it does not exist or updated if row exists for a Application' ||
    ' or Full data type migration, otherwise,a record is created in DT_DELETES table.',
     l_indent) || indent;
Line: 1391

  'if l_row_exists = ''N'' then' || indent(l_indent + 2) ||'l_insert := TRUE;'
Line: 1392

   || indent(l_indent + 2) ||'l_update := FALSE;' || indent(l_indent) ||
Line: 1395

   format_comment('if migration_type is application then update the row',
                   l_indent + 2);
Line: 1401

  indent(l_indent) || 'l_update := TRUE;'||
Line: 1402

  indent(l_indent - 2) || 'else' || indent(l_indent) ||'l_update := FALSE;' ||
Line: 1403

   indent(l_indent) || '-- write into dt_deletes_table' || indent(l_indent);
Line: 1406

  prepare_ins_dt_delete_stmt
  ( p_table_info  => p_table_info,
    p_proc_body   => l_proc_body,
    p_ins_type    => 'P',
    p_indent => l_indent);
Line: 1419

     indent(l_indent + 2) || 'l_insert := TRUE;' || indent(l_indent) ||
Line: 1498

              '  l_insert                   boolean := FALSE;' || indent ||
Line: 1499

              '  l_update                   boolean := FALSE;' || indent ||
Line: 1564

  '-- if l_insert flag is true then insert the row. ' ||indent(l_indent )
  || 'if l_insert then ' || indent(l_indent + 2)
  || 'insert_dml (' ;
Line: 1634

    '-- if l_update flag is true then update the row. ' ||indent(l_indent)
    || 'if l_update then ' || indent(l_indent + 2)
    || 'update_dml (' ;
Line: 1872

  l_cursor_select_cols   varchar2(32767);
Line: 1873

  l_cursor_select_from   varchar2(32767);
Line: 1874

  l_cursor_select_where  varchar2(32767);
Line: 1892

     l_cursor_select_cols := '  select ' || p_table_info.surrogate_pk_column_name;
Line: 1894

     l_cursor_select_cols := '  select ''1''' ;
Line: 1903

                               p_from_clause  => l_cursor_select_from);
Line: 1905

    l_cursor_select_from := '  from  ' || p_table_info.upload_table_name  || ' ' || p_table_info.alias;
Line: 1916

                                   p_where_clause => l_cursor_select_where);
Line: 1919

    l_cursor_select_where := g_chk_row_exists.where_clause ;
Line: 1923

     l_cursor_select_where := '  where' || hr_dm_library.get_func_asg (
                           p_rpad_spaces     => 0,
                           p_columns_tbl     => g_pk_columns_tbl,
                           p_prefix_left_asg => p_table_info.alias || '.' ,
                           p_prefix_right_asg => 'p_',
                           p_omit_business_group_id  => 'N',
                           p_comma_on_first_line     => 'N',
                           p_pad_first_line          => 'N',
                           p_equality_sign           => ' = ',
                           p_left_asg_pad_len        => 80,
                           p_right_asg_pad_len       => 80,
                           p_start_terminator        => '  and   ',
                           p_test_with_nvl           => 'Y',
                           p_table_name              => upper(p_table_info.upload_table_name))
                           ||';';
Line: 1943

              l_cursor_select_cols  || indent ||
              l_cursor_select_from  || indent ||
              l_cursor_select_where || indent;
Line: 1982

  l_delete_operand          varchar2(30);
Line: 1984

  l_delete_seperator        varchar2(30);
Line: 2011

  select ORACLE_USERNAME
  from fnd_oracle_userid
  where ORACLE_ID = 900;
Line: 2020

  select lower(hir.column_name) column_name ,
         lower(col.data_type) data_type,
         hir.hierarchy_type,
         lower(dmt.table_alias) table_alias,
         tbl.table_name table_name
  from all_tab_columns col,
       hr_dm_tables  tbl,
       hr_dm_tables  dmt,
       hr_dm_hierarchies hir
  where tbl.table_name = nvl(dmt.upload_table_name, dmt.table_name)
  and dmt.table_id = p_table_info.table_id
  and hierarchy_type = 'R'
  and tbl.table_id = hir.table_id
  and col.table_name =  tbl.table_name
  and col.column_name = hir.column_name
  and col.owner in
  (l_apps_name,
   l_fnd_owner,
   l_ff_owner,
   l_ben_owner,
   l_pay_owner,
   l_per_owner);
Line: 2092

     g_delete_dml.where_clause            := '  where ';
Line: 2093

     g_delete_dml.call_to_proc    := 'delete_dml (';
Line: 2094

     g_delete_dml.proc_parameters := '(';
Line: 2099

     l_delete_operand := '';
Line: 2101

     l_delete_seperator := '';
Line: 2138

         g_delete_dml.where_clause  := g_delete_dml.where_clause ||
               l_delete_operand || ' ' || l_nvl_left ||
               csr_get_chk_columns_rec.table_alias || '.' ||
           substr(csr_get_chk_columns_rec.column_name,1,28) || l_nvl_right ||  ' = ' ||
           rpad(l_nvl_left ||'p_' ||
           csr_get_chk_columns_rec.column_name || l_nvl_right,80) || indent(2);
Line: 2146

        g_delete_dml.proc_parameters := g_delete_dml.proc_parameters
          || l_delete_seperator || rpad('p_' || csr_get_chk_columns_rec.column_name,30) || '    ' ||
             csr_get_chk_columns_rec.data_type || indent;
Line: 2150

         l_delete_operand := 'and   ';
Line: 2185

            g_delete_dml.call_to_proc := g_delete_dml.call_to_proc
              || l_delete_seperator || rpad('p_' || csr_get_chk_columns_rec.column_name,30) ||
               indent (l_indent + 15);
Line: 2188

            l_delete_seperator := ',';
Line: 2197

            g_delete_dml.call_to_proc := g_delete_dml.call_to_proc
              || l_delete_seperator || rpad('l_' || csr_get_chk_columns_rec.column_name,30) ||
               indent (l_indent + 15);
Line: 2200

            l_delete_seperator := ',';
Line: 2232

     g_delete_dml.where_clause  := g_delete_dml.where_clause || ';';
Line: 2234

     g_delete_dml.call_to_proc := g_delete_dml.call_to_proc || ');';
Line: 2235

     g_delete_dml.proc_parameters := g_delete_dml.proc_parameters || ')';
Line: 2330

procedure generate_insert_dml
(
  p_table_info       in     hr_dm_gen_main.t_table_info
)
is
  l_interface    varchar2(32767);
Line: 2352

  hr_dm_utility.message('ROUT','entry:hr_dm_gen_tups.generate_insert_dml', 5);
Line: 2368

              '|| ''insert_dml'';' || indent;
Line: 2404

                '  select 1' || indent(l_indent) ||
                '  from ' || p_table_info.upload_table_name || indent(l_indent) ||
                '  where ' || p_table_info.surrogate_pk_column_name || ' = ' ||
                '        p_' || p_table_info.surrogate_pk_column_name || ';'
Line: 2413

                '  select ' || p_table_info.sequence_name ||
                '.nextval' || indent(l_indent) ||
                '  from dual;'
Line: 2429

                  format_comment('insert the row', l_indent) || indent ||
                   '  insert into ' || p_table_info.upload_table_name || indent(l_indent)
                   || '( ' || indent(l_indent) ||
                   hr_dm_library.conv_list_to_text (
                   p_rpad_spaces    => l_indent + 1,
                   p_pad_first_line => 'Y',
                   p_columns_tbl    =>  g_columns_tbl);
Line: 2446

                   ');' || indent || 'end insert_dml;';
Line: 2453

           format_comment('see if id value already used and no DT_DELETE' ||
                          ' entry exists.', l_indent) || indent;
Line: 2458

    prepare_chk_dt_delete_stmt
      (p_table_info  => p_table_info,
       p_proc_body   => l_temp,
       p_indent      => l_indent);
Line: 2546

                  format_comment('insert the row', l_indent) || indent ||
                   '  insert into ' || p_table_info.upload_table_name || indent(l_indent)
                   || '( ' || indent(l_indent) ||
                   hr_dm_library.conv_list_to_text (
                   p_rpad_spaces    => l_indent + 1,
                   p_pad_first_line => 'Y',
                   p_columns_tbl    =>  g_columns_tbl);
Line: 2563

                   ');' || indent || 'end insert_dml;';
Line: 2569

  l_proc_comment := format_comment('procedure to insert a row in '
  || upper(p_table_info.upload_table_name) || 'table.')||
  indent;
Line: 2576

  l_proc_body_tbl(1)  :=  l_proc_comment || 'procedure insert_dml' ||
         l_proc_body_tbl(1) || ' is' || l_locals || 'begin' ||indent;
Line: 2581

  hr_dm_utility.message('ROUT','exit:hr_dm_gen_tups.generate_insert_dml',
                         25);
Line: 2585

     hr_dm_utility.error(SQLCODE,'hr_dm_gen_tups.generate_insert_dml',
                         '(none)','R');
Line: 2588

end generate_insert_dml;
Line: 2593

procedure generate_update_dml
(
  p_table_info       in     hr_dm_gen_main.t_table_info
)
is
  l_interface    varchar2(32767);
Line: 2615

  hr_dm_utility.message('ROUT','entry:hr_dm_gen_tups.generate_update_dml', 5);
Line: 2632

              '|| ''update_dml'';' || indent;
Line: 2661

    l_proc_body_tbl(l_proc_index) := format_comment('update all columns of' ||
              ' the row.', l_indent)  || indent ||
              '  update ' || p_table_info.upload_table_name || ' ' || p_table_info.alias
              || indent(l_indent) || 'set ' ||
               hr_dm_library.get_func_asg (
                             p_rpad_spaces     => l_indent + 4,
                             p_columns_tbl     => l_columns_tbl,
                             p_prefix_left_asg => null ,
                             p_omit_business_group_id  => 'N',
                             p_comma_on_first_line     => 'N',
                             p_pad_first_line          => 'N',
                             p_equality_sign           => ' = ');
Line: 2701

      ' contain any columns other than primary key column. Hence no update' ||
      ' statement is required.', l_indent) || indent(l_indent) || 'null;';
Line: 2706

  l_proc_body_tbl(l_proc_index) :=  indent || 'end update_dml;';
Line: 2709

  l_proc_comment := format_comment('procedure to update a row in '
  || upper(p_table_info.upload_table_name) || ' table.') ||  indent;
Line: 2713

   l_proc_body_tbl(1) :=  l_proc_comment || 'procedure update_dml' ||
              l_proc_body_tbl(1) || ' is'|| l_locals || indent ||
             'begin'  || indent;
Line: 2719

  hr_dm_utility.message('ROUT','exit:hr_dm_gen_tups.generate_update_dml',
                         25);
Line: 2723

     hr_dm_utility.error(SQLCODE,'hr_dm_gen_tups.generate_update_dml',
                         '(none)','R');
Line: 2726

end generate_update_dml;
Line: 2818

                 indent||format_comment('update all columns of the row.',l_indent);
Line: 2822

  l_proc_body_tbl(l_proc_index) := indent(l_indent)||'update ' ||
                                   p_table_info.upload_table_name ||
                                   indent(l_indent)||'set ';
Line: 2886

procedure generate_delete_dml
(
  p_table_info       in     hr_dm_gen_main.t_table_info
)
is
  l_interface    varchar2(32767);
Line: 2905

  hr_dm_utility.message('ROUT','entry:hr_dm_gen_tups.generate_delete_dml', 5);
Line: 2911

    l_interface :=  indent || g_delete_dml.proc_parameters || indent;
Line: 2926

              '|| ''delete_dml'';' || indent;
Line: 2930

  l_proc_body := format_comment('delete the logical records for the given id.',
                                 l_indent)  || indent;
Line: 2936

                    '  delete ff_compiled_info_f where formula_id in (
                       select '||p_table_info.alias||'.formula_id
                         from ff_formulas_f '||p_table_info.alias;
Line: 2941

                                       replace(g_delete_dml.where_clause,';','')||');'||indent(l_indent) ;
Line: 2947

                 '  delete ' || p_table_info.upload_table_name || ' ' ||
                 p_table_info.alias;
Line: 2952

                                       g_delete_dml.where_clause ;
Line: 2972

  l_proc_body := l_proc_body || indent || 'end delete_dml;';
Line: 2975

  l_proc_comment := format_comment('procedure to delete the logical record for'
  ||  ' a given id in '|| upper(p_table_info.upload_table_name) || ' table.')||
  indent;
Line: 2982

  l_proc_body_tbl(1) :=   l_proc_comment || 'procedure delete_dml' ||
                     l_interface || ' is' || l_locals || 'begin' ||
                     indent || l_proc_body ;
Line: 2988

  hr_dm_utility.message('ROUT','exit:hr_dm_gen_tups.generate_delete_dml',
                         25);
Line: 2992

     hr_dm_utility.error(SQLCODE,'hr_dm_gen_tups.generate_delete_dml',
                         '(none)','R');
Line: 2995

end generate_delete_dml;
Line: 3167

    generate_insert_dml (p_table_info);
Line: 3176

       generate_update_dml (p_table_info );
Line: 3178

       generate_delete_dml (p_table_info);