--
-- upgrade-4.0.1a-4.0.1b.sql
--
-- aegrumet@arsdigita.com
--
-- create pa_jobs table and put an entry in it

-- this table should have just one row
-- to hold the dbms job for rebuilding the
-- search index.
create table pa_jobs (
  job integer not null primary key
);

declare
  cursor cur is
  select job
  from user_jobs
  where what = 'pa_rebuild_idx;';
begin
  for job in cur loop
   insert into pa_jobs (job) values (job.job);
  end loop;
end;
/
show errors
