relation_segment_has_dependent (public)
relation_segment_has_dependent [ -rel_id rel_id ] \ [ -segment_id segment_id ] [ -party_id party_id ]
Defined in packages/acs-subsite/tcl/relation-procs.tcl
Returns 1 if the specified segment/party combination has a dependent (meaning a constraint would be violated if we removed this relation). 0 otherwise. Either
rel_id
orsegment_id
andparty_id
must be specified.rel_id
takes precedence.
- Switches:
- -rel_id
(optional)- -segment_id
(optional)- -party_id
(optional)- Author:
- Michael Bryzek <mbryzek@arsdigita.com>
- Created:
- 12/2000
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- demote_promote_a_user
Source code: if { $rel_id ne "" } { if { ![db_0or1row select_rel_info {}] } { # There is either no relation or no segment... thus no dependents return 0 } } if { $segment_id eq "" || $party_id eq "" } { error "Both of segment_id and party_id must be specified in call to relation_segment_has_dependent" } return [db_string others_depend_p {}]Generic XQL file: <fullquery name="relation_segment_has_dependent.select_rel_info"> <querytext> select s.segment_id, r.object_id_two as party_id from rel_segments s, acs_rels r where r.object_id_one = s.group_id and r.rel_type = s.rel_type and r.rel_id = :rel_id </querytext> </fullquery> <fullquery name="relation_segment_has_dependent.others_depend_p"> <querytext> select case when exists (select 1 from rc_violations_by_removing_rel r where r.rel_id = :rel_id) then 1 else 0 end from dual </querytext> </fullquery>packages/acs-subsite/tcl/relation-procs.xql
PostgreSQL XQL file: packages/acs-subsite/tcl/relation-procs-postgresql.xql
Oracle XQL file: packages/acs-subsite/tcl/relation-procs-oracle.xql