oracle存储过程中应该是一个session先进行insert多条数据没有commit查询不到数据
insert into gq_data_epr_project(item_3_1,item_3_2,item_3_3,item_3_4,pos_code)
select extractvalue(org, '/com_proposal/basic_info/xm_no'),
extractvalue(org, '/com_proposal/basic_info/xm_name'),
to_date(extractvalue(org,'/com_proposal/basic_info/start_date'),'yyyy-mm-dd'),
extractvalue(org,'/com_proposal/basic_info/kfxm_jsly_value'),
v_pos_code
from (select x1.column_value as org
from xmltable('data/com_proposals/com_proposal' passing
v_proposal_xml) x1) x2;
--更新技术领域,将技术领域更新为对接要求的方式
declare
cursor c_job is select t.pos_code,t.item_3_1,t.item_3_2,t.item_3_3 from gq_data_epr_project t where t.pos_code=v_pos_code;
c_row c_job%rowtype;
v_item_3_4 varchar2(10);
v_pid_1 varchar2(10);
v_pid_2 varchar2(10);
v_item_str varchar2(100);
begin
select t.item_3_4 into v_item_3_4 from gq_data_epr_project t where t.item_3_1=c_row.item_3_1 and t.item_3_2=c_row.item_3_2 and t.item_3_3=c_row.item_3_3 and t.pos_code=c_row.pos_code;
select t.pid into v_pid_1 from const_gxjsqy_tech_new_temp t where t.option_val=v_item_3_4;
select t.pid into v_pid_2 from const_gxjsqy_tech_new_temp t where t.option_val=v_pid_1;
v_item_str:=v_pid_2||','||v_pid_1||','||v_item_3_4;
update gq_data_epr_project t set t.item_3_1=v_item_str where t.item_3_1=c_row.item_3_1 and t.item_3_2=c_row.item_3_2 and t.item_3_3=c_row.item_3_3 and t.pos_code=c_row.pos_code;
end;
如上sql都是在一个存储过程中,先使用一个insert into 语句,插入多条数据到gq_data_epr_project表中,此处没有使用commit,断点调试到定义游标时查询不到数据,按说应该是在一个session内,就算没有commit,应该也是能查询到数据的吧,为什么查不到数据呢,如果不使用commit,还有其他的解决方法吗?