Home » SQL & PL/SQL » SQL & PL/SQL » Run same procedure parallely in different sessions with diff parameter value (Oracle 11g)
Run same procedure parallely in different sessions with diff parameter value [message #602113] Fri, 29 November 2013 10:30 Go to next message
srinivas.k2005
Messages: 404
Registered: August 2006
Senior Member
Hi,

I have to run a procedure in one go with different value passed to it in multiple session.

I was doing a small POC on same, but i see the below behave weird, first time it created 5 job and inserted data to table 5 records , but when i again ran the same block the job where in dba_jobs table and never inserted the data .
I saw the inconsistent behaviour.

Can you guide me the best way to achieve the below

create table log_t ( a number, b varchar2(100), c varchar2(1000), d number);

create or replace procedure pr_test(a number)
is
begin
insert into log_t(a) values ( 1);
commit;
end;


declare
v_job number;
v_session_no number := 5;
begin
for i in 1..v_session_no loop
dbms_job.submit(v_job,'pr_test('||v_session_no||');',sysdate+ 1/24/60,NULL);
dbms_output.put_line('v_job  '||v_job);
END LOOP;
end;



Thanks
SRK

[Updated on: Fri, 29 November 2013 10:31]

Report message to a moderator

Re: Run same procedure parallely in different sessions with diff parameter value [message #602128 is a reply to message #602113] Fri, 29 November 2013 14:06 Go to previous message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

1/ You must commit for the job to be taken into account
2/ Check job_queue_processes
3/ Check alert.log for any error

Previous Topic: not able to execute the explain plan in development in TOAD
Next Topic: how to write this update query?
Goto Forum:
  


Current Time: Fri Apr 26 11:37:47 CDT 2024