Index: openacs-4/packages/adserver/sql/postgresql/adserver-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/adserver/sql/postgresql/adserver-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/adserver/sql/postgresql/adserver-create.sql 6 Mar 2002 20:04:45 -0000 1.2 +++ openacs-4/packages/adserver/sql/postgresql/adserver-create.sql 25 Jul 2004 11:20:54 -0000 1.3 @@ -162,7 +162,6 @@ -- 'ArsDigita', 't', 't', 'arsdigita.gif', 'http://www.arsdigita.com' -- ); -commit; -------------------------------------------------- -------------------------------------------------- @@ -238,13 +237,13 @@ -- statement level trigger to perform the swaps. create function advs_count_afr_del_fun() returns opaque as ' declare - next integer; + v_next integer; s record; begin -- find the highest numbered ad -- advs_properties is guaranteed to exist. select adv_count - into next + into v_next from advs_properties; -- for update; -- do I need the for update? @@ -254,19 +253,19 @@ -- find the ad that has that number and renumber it update advs set adv_number = s.swap - where adv_number = next - 1; + where adv_number = v_next - 1; -- delete the row delete from advs_swaps where swap = s.swap; - next := next - 1; + v_next := v_next - 1; end loop; -- update the highest number update advs_properties - set adv_count = next; + set adv_count = v_next; return new; end;