Oracle plsql パッケージ内で以下のコードをコンパイルすると、コンパイル エラーが発生しました。エラーは次のようになります。
PACKAGE BODY tttt_KP_ALLOCATION のコンパイル エラー
エラー: PL/SQL: ORA-02287: ここではシーケンス番号を使用できません行: 3465 テキスト: all_kp_prior_seq.nextvalprior_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);