Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-communities-package-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-package-create.sql 29 Mar 2002 20:03:01 -0000 1.1 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-package-create.sql 3 Apr 2002 00:33:12 -0000 1.2 @@ -164,6 +164,10 @@ party_id in parties.party_id%TYPE ) return char; + function has_subcomm_p ( + community_id in dotlrn_communities.community_id%TYPE + ) return char; + function url ( community_id in dotlrn_communities.community_id%TYPE ) return varchar2; @@ -314,6 +318,24 @@ when no_data_found then return ''; end; + + function has_subcomm_p ( + community_id in dotlrn_communities.community_id%TYPE + ) return char + is + v_rv char(1); + begin + + select decode(count(*), 0, 'f', 't') into v_rv + from dual where exists ( + select 'x' + from dotlrn_communities + where parent_community_id = community_id + ); + + return v_rv; + end; + end; / show errors