0

在 Oracle plsql 包中编译以下代码时出现编译错误。错误是这样的:

PACKAGE BODY tttt_KP_ALLOCATION 的编译错误

错误:PL/SQL:ORA-02287:此处不允许序列号行:3465 文本:all_kp_prior_seq.nextval prior_seq_no,

错误:PL/SQL:忽略 SQL 语句行:3404 文本:插入到 all_pat_list

  tttt_sys_pkg.reset_sequence('ALL_KP_PRIOR_SEQ', 1);

  insert into all_pat_list
    (apl_id,
     all_id,
     prod_id,
     prior_seq_no,
     org_code,
     all_step_no,
     pat_id,
     pat_name,
     sex,
     dob,
     ped_ind,
     blood_typ,
     home_prov_code,
     home_town,
     org_code_registered,
     org_descrip_registered,
     hosp_id,
     mrn,
     oldr_code,
     current_wait_list_stat_code,
     init_wait_list_stat_date,
     dis_code_prim_diag,
     dis_code_sec_diag,
     cadaver_liv_ind,
     weight,
     height,
     abdom_girth,
     chest_circum,
     chest_vert_right,
     chest_vert_left,
     chest_transverse,
     cmv,
     ebv,
     hepatitis_b_surface_ant,
     hepatitis_c,
     prev_trnsplt_no,
     all_step_descrip,
     eff_date,
     hcv_rna,
     dsa_cur_unaccp1,
     dsa_acc_unaccp1,
     dsa_cur_indet1,
     dsa_acc_indet1,
     dsa_cur_unaccp2,
     dsa_acc_unaccp2,
     dsa_cur_indet2,
     dsa_acc_indet2,
     x_match_serum_date,
     x_match_b_cell_res_ind,
     x_match_t_cell_res_ind,
     current_pra,
     current_pra_date,
     peak_pra,
     peak_pra_date,
     kp_allocation_points,
     cpra,
     patr_id)
    select apl_id,
           all_id,
           prod_id,
           all_kp_prior_seq.nextval prior_seq_no,
           org_code,
           all_step_no,
           pat_id,
           pat_name,
           sex,
           dob,
           ped_ind,
           blood_typ,
           home_prov_code,
           home_town,
           org_code_registered,
           org_descrip_registered,
           hosp_id,
           mrn,
           oldr_code,
           current_wait_list_stat_code,
           init_wait_list_stat_date,
           dis_code_prim_diag,
           dis_code_sec_diag,
           cadaver_liv_ind,
           weight,
           height,
           abdom_girth,
           chest_circum,
           chest_vert_right,
           chest_vert_left,
           chest_transverse,
           cmv,
           ebv,
           hepatitis_b_surface_ant,
           hepatitis_c,
           prev_trnsplt_no,
           all_step_descrip,
           eff_date,
           hcv_rna,
           dsa_cur_unaccp1,
           dsa_acc_unaccp1,
           dsa_cur_indet1,
           dsa_acc_indet1,
           dsa_cur_unaccp2,
           dsa_acc_unaccp2,
           dsa_cur_indet2,
           dsa_acc_indet2,
           x_match_serum_date,
           x_match_b_cell_res_ind,
           x_match_t_cell_res_ind,
           current_pra,
           current_pra_date,
           peak_pra,
           peak_pra_date,
           kp_allocation_points,
           cpra,
           patr_id
      from temp_kp_all_pat_list_pool
     order by prior_seq_no;

谁可以帮助我将不胜感激!!!请给我正确的代码,非常感谢。

阅读 Ed 的帖子后,我修改了如下代码,现在可以通过编译了。

tttt_sys_pkg.reset_sequence('ALL_KP_PRIOR_SEQ', 1);

insert into all_pat_list
  (apl_id,
   all_id,
   prod_id,
   prior_seq_no,
   org_code,
   all_step_no,
   pat_id,
   pat_name,
   sex,
   dob,
   ped_ind,
   blood_typ,
   home_prov_code,
   home_town,
   org_code_registered,
   org_descrip_registered,
   hosp_id,
   mrn,
   oldr_code,
   current_wait_list_stat_code,
   init_wait_list_stat_date,
   dis_code_prim_diag,
   dis_code_sec_diag,
   cadaver_liv_ind,
   weight,
   height,
   abdom_girth,
   chest_circum,
   chest_vert_right,
   chest_vert_left,
   chest_transverse,
   cmv,
   ebv,
   hepatitis_b_surface_ant,
   hepatitis_c,
   prev_trnsplt_no,
   all_step_descrip,
   eff_date,
   hcv_rna,
   dsa_cur_unaccp1,
   dsa_acc_unaccp1,
   dsa_cur_indet1,
   dsa_acc_indet1,
   dsa_cur_unaccp2,
   dsa_acc_unaccp2,
   dsa_cur_indet2,
   dsa_acc_indet2,
   x_match_serum_date,
   x_match_b_cell_res_ind,
   x_match_t_cell_res_ind,
   current_pra,
   current_pra_date,
   peak_pra,
   peak_pra_date,
   kp_allocation_points,
   cpra,
   patr_id)
  select apl_id,
         all_id,
         prod_id,
         all_kp_prior_seq.nextval prior_seq_no,
         org_code,
         all_step_no,
         pat_id,
         pat_name,
         sex,
         dob,
         ped_ind,
         blood_typ,
         home_prov_code,
         home_town,
         org_code_registered,
         org_descrip_registered,
         hosp_id,
         mrn,
         oldr_code,
         current_wait_list_stat_code,
         init_wait_list_stat_date,
         dis_code_prim_diag,
         dis_code_sec_diag,
         cadaver_liv_ind,
         weight,
         height,
         abdom_girth,
         chest_circum,
         chest_vert_right,
         chest_vert_left,
         chest_transverse,
         cmv,
         ebv,
         hepatitis_b_surface_ant,
         hepatitis_c,
         prev_trnsplt_no,
         all_step_descrip,
         eff_date,
         hcv_rna,
         dsa_cur_unaccp1,
         dsa_acc_unaccp1,
         dsa_cur_indet1,
         dsa_acc_indet1,
         dsa_cur_unaccp2,
         dsa_acc_unaccp2,
         dsa_cur_indet2,
         dsa_acc_indet2,
         x_match_serum_date,
         x_match_b_cell_res_ind,
         x_match_t_cell_res_ind,
         current_pra,
         current_pra_date,
         peak_pra,
         peak_pra_date,
         kp_allocation_points,
         cpra,
         patr_id
    from (select apl_id,
                 all_id,
                 prod_id,
                 prior_seq_no,
                 org_code,
                 all_step_no,
                 pat_id,
                 pat_name,
                 sex,
                 dob,
                 ped_ind,
                 blood_typ,
                 home_prov_code,
                 home_town,
                 org_code_registered,
                 org_descrip_registered,
                 hosp_id,
                 mrn,
                 oldr_code,
                 current_wait_list_stat_code,
                 init_wait_list_stat_date,
                 dis_code_prim_diag,
                 dis_code_sec_diag,
                 cadaver_liv_ind,
                 weight,
                 height,
                 abdom_girth,
                 chest_circum,
                 chest_vert_right,
                 chest_vert_left,
                 chest_transverse,
                 cmv,
                 ebv,
                 hepatitis_b_surface_ant,
                 hepatitis_c,
                 prev_trnsplt_no,
                 all_step_descrip,
                 eff_date,
                 hcv_rna,
                 dsa_cur_unaccp1,
                 dsa_acc_unaccp1,
                 dsa_cur_indet1,
                 dsa_acc_indet1,
                 dsa_cur_unaccp2,
                 dsa_acc_unaccp2,
                 dsa_cur_indet2,
                 dsa_acc_indet2,
                 x_match_serum_date,
                 x_match_b_cell_res_ind,
                 x_match_t_cell_res_ind,
                 current_pra,
                 current_pra_date,
                 peak_pra,
                 peak_pra_date,
                 kp_allocation_points,
                 cpra,
                 patr_id
            from temp_kp_all_pat_list_pool
           order by prior_seq_no);
4

1 回答 1

1

我只是尝试了类似的东西,认为它是分配给序列值的别名。您不需要别名,但事实证明这是无害的。

问题?这是order by. 如果你摆脱它,错误就会消失。无论如何,在执行INSERT订单时应该并不重要。

于 2013-06-20T19:51:58.840 回答