Index: openacs-4/packages/acs-kernel/sql/oracle/tree-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/tree-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-kernel/sql/oracle/tree-create.sql 30 May 2002 18:08:05 -0000 1.1 +++ openacs-4/packages/acs-kernel/sql/oracle/tree-create.sql 24 Jun 2002 21:10:46 -0000 1.2 @@ -130,7 +130,7 @@ then return '000000'; else - return (int_to_hex(hex_to_int(tree_key) +1)); + return (lpad(int_to_hex(hex_to_int(tree_key) + 1)), 6, '0'); end if; end increment_key; @@ -140,7 +140,7 @@ ) return raw is begin - return parent_key || lpad(increment_key(max_child_key), 6, '0'); + return parent_key || increment_key(max_child_key); end next_key; function left ( Index: openacs-4/packages/dotlrn/sql/oracle/communities-tree-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/communities-tree-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/oracle/communities-tree-create.sql 31 May 2002 06:23:49 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/oracle/communities-tree-create.sql 24 Jun 2002 21:10:48 -0000 1.3 @@ -35,7 +35,7 @@ end if; -- increment the sort_key - v_max_child_sortkey := lpad(tree.increment_key(v_max_child_sortkey), 6, '0'); + v_max_child_sortkey := tree.increment_key(v_max_child_sortkey); update dotlrn_community_types set max_child_sortkey = v_max_child_sortkey @@ -73,7 +73,7 @@ end if; -- increment the sort_key - v_max_child_sortkey := lpad(tree.increment_key(v_max_child_sortkey), 6, '0'); + v_max_child_sortkey := tree.increment_key(v_max_child_sortkey); if :new.parent_community_id is null then update dotlrn_community_types Index: openacs-4/packages/forums/sql/oracle/forums-tree-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/sql/oracle/forums-tree-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/forums/sql/oracle/forums-tree-create.sql 29 May 2002 21:40:10 -0000 1.1 +++ openacs-4/packages/forums/sql/oracle/forums-tree-create.sql 24 Jun 2002 21:10:46 -0000 1.2 @@ -21,14 +21,14 @@ v_max_child_sortkey forums_messages.max_child_sortkey%TYPE; v_parent_sortkey forums_messages.tree_sortkey%TYPE; begin - if :new.parent_id is NULL + if :new.parent_id is null then -- get the max from the forum select max_child_sortkey into v_max_child_sortkey from forums_forums where forum_id= :new.forum_id for update of max_child_sortkey; - v_parent_sortkey:= NULL; + v_parent_sortkey:= null; else -- get the max child sortkey from parent -- grab the lock @@ -40,15 +40,17 @@ end if; -- increment the sortkey - v_max_child_sortkey:= lpad(tree.increment_key(v_max_child_sortkey),6,'0'); + v_max_child_sortkey:= tree.increment_key(v_max_child_sortkey); if :new.parent_id is null then - update forums_forums set max_child_sortkey= v_max_child_sortkey + update forums_forums + set max_child_sortkey = v_max_child_sortkey where forum_id= :new.forum_id; else -- update the parent - update forums_messages set max_child_sortkey= v_max_child_sortkey + update forums_messages + set max_child_sortkey = v_max_child_sortkey where message_id= :new.parent_id; end if;