single threading access to a table. how?

From: Barry Hannigan; EdTel <hannigan_at_cs.ualberta.ca>
Date: 24 Mar 1994 04:00:59 GMT
Message-ID: <2mr39r$kc8_at_scapa.cs.ualberta.ca>


greets.

i have this problem, cant figure solution. a table X serves as a data store for procedure Y. the goal is to have a number of processes transferring the transactions stored in table X to procedure Y, however the following plsqlish code fragment has the opportunity of submitting the same record <n> times, where n is the number of processes. i would like to be able to do something like a sybase "read lock" on the table. (never thought that would be useful!)

  declare c1 cursor for
    select record from X where status = 'R' for update;

  while <true> loop
   open c1;
   fetch c1 into :Xr;
   Y(Xr);
   delete X where current of c1;
   close c1;
   commit;
  end loop;

 any solutions ??

barry

--
   4 players            | barry hannigan             | 
   inferno              |  1960-10303 jasper ave     | death to videodrome
   nightmare            |  edmonton, alberta         | long live the new flesh
   deathmatch on net 666|  t5a 4k5                   |  
Received on Thu Mar 24 1994 - 05:00:59 CET

Original text of this message