Can We use threading in PL/SQL?

+1 for DBMS_SCHEDULER and DBMS_JOB approaches, but also consider whether you ought to be using a different approach.

If you have a procedure which executes in a row-by-row manner and you find that it is slow, the answer is probably not to run the procedure multiple times simltaneously but to ensure that a set-based aproach is used instead. At an extreme you can even then use parallel query and parallel DML to reduce the wall clock time of the process.

I mention this only because it is a very common fault.


Submit it in a DBMS_JOB like so:

declare
  ln_dummy number;
begin
  DBMS_JOB.SUBMIT(ln_dummy, 'begin myProc(1,100); end;');
  DBMS_JOB.SUBMIT(ln_dummy, 'begin myProc(101,200); end;');
  DBMS_JOB.SUBMIT(ln_dummy, 'begin myProc(201,300); end;');
  COMMIT;
end;

You'll need the job_queue_processes parameter set to >0 to spawn threads to process the jobs. You can query the jobs by examining the view user_jobs.

Note that this applies to Oracle 9i, not sure what support 10g has. See more info here.

EDIT: Added missed COMMIT