relation-procs-postgresql.xql

DB Query file

Related Files

[ hide source ] | [ make this the default ]

File Contents

<?xml version="1.0"?>

<queryset>
   <rdbms><type>postgresql</type><version>7.1</version></rdbms>

<fullquery name="relation_add.select_rel_violation">      
      <querytext>
        select rel_constraint__violation(:rel_id) 
      </querytext>
</fullquery>
 
<fullquery name="relation_remove.relation_delete">      
      <querytext>
        select ${package_name}__delete(:rel_id) from dual
      </querytext>
</fullquery>
 
<fullquery name="relation_types_valid_to_group_multirow.select_sub_rel_types">      
      <querytext>    
	select
		pretty_name, object_type, level, indent,
		case when valid_types.rel_type = null then 0 else 1 end as valid_p
	from 
		(select
			t2.pretty_name, t2.object_type, tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey) as level,
		        repeat('&nbsp;', (tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey)) * 4) as indent,
	        	t2.tree_sortkey as sortkey
		from
			acs_object_types t1,
			acs_object_types t2
		where	t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)
		  and   t1.object_type = :start_with) types left join
		(select
			rel_type
		from
			rc_valid_rel_types
		where
			group_id= :group_id) valid_types
	on (types.object_type = valid_types.rel_type)
	order by sortkey
		

	
      </querytext>
</fullquery>
 
</queryset>