Class ::xo::db::sql::rel_constraint (public)

 ::xo::db::Class ::xo::db::sql::rel_constraint[i]

Defined in

Testcases:
No testcase defined.
Source code:
namespace eval ::xo::db::sql {}
::nsf::object::alloc ::xo::db::Class ::xo::db::sql::rel_constraint {set :__default_metaclass ::xotcl::Class
   set :__default_superclass ::xotcl::Object
   set :abstract_p f
   set :auto_save false
   set :name_method {}
   set :object_type ::xo::db::sql::rel_constraint
   set :security_inherit_p t
   set :sql_package_name rel_constraint
   set :supertype acs_object
   set :with_table true}
::xo::db::sql::rel_constraint proc get_constraint_id {{-dbn {}} -rel_segment:required -rel_side:required -required_rel_segment:required} {
      #function_args: {REL_SEGMENT {}} {REL_SIDE {}} {REQUIRED_REL_SEGMENT {}}
      foreach var [list REL_SEGMENT REL_SIDE REQUIRED_REL_SEGMENT]  {
        set varname [string tolower $var]
        if {[info exists $varname]} {
          set $var [set $varname]
          set _$var :$var
        } else {
          set _$var null
        }
      }
      set sql "
      select rel_constraint__get_constraint_id($_REL_SEGMENT$_REL_SIDE$_REQUIRED_REL_SEGMENT) 
    "
      db_with_handle -dbn $dbn db {
        #ns_log notice "--sql=$sql"
        return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
      }
    }
::xo::db::sql::rel_constraint proc violation_if_removed {{-dbn {}} -rel_id:required} {
      #function_args: {REL_ID {}}
      foreach var [list REL_ID]  {
        set varname [string tolower $var]
        if {[info exists $varname]} {
          set $var [set $varname]
          set _$var :$var
        } else {
          set _$var null
        }
      }
      set sql "
      select rel_constraint__violation_if_removed($_REL_ID) 
    "
      db_with_handle -dbn $dbn db {
        #ns_log notice "--sql=$sql"
        return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
      }
    }
::xo::db::sql::rel_constraint proc violation {{-dbn {}} -rel_id:required} {
      #function_args: {REL_ID {}}
      foreach var [list REL_ID]  {
        set varname [string tolower $var]
        if {[info exists $varname]} {
          set $var [set $varname]
          set _$var :$var
        } else {
          set _$var null
        }
      }
      set sql "
      select rel_constraint__violation($_REL_ID) 
    "
      db_with_handle -dbn $dbn db {
        #ns_log notice "--sql=$sql"
        return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
      }
    }
::xo::db::sql::rel_constraint proc violation_if_re {{-dbn {}} -rel_id:required} {
      #function_args: {REL_ID {}}
      foreach var [list REL_ID]  {
        set varname [string tolower $var]
        if {[info exists $varname]} {
          set $var [set $varname]
          set _$var :$var
        } else {
          set _$var null
        }
      }
      set sql "
      select rel_constraint__violation_if_re($_REL_ID) 
    "
      db_with_handle -dbn $dbn db {
        #ns_log notice "--sql=$sql"
        return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
      }
    }
::xo::db::sql::rel_constraint proc new {{-dbn {}} -constraint_id {-constraint_type rel_constraint} -constraint_name:required -rel_segment:required {-rel_side two} -required_rel_segment:required -context_id -creation_user -creation_ip -childof} {
      #function_args: {CONSTRAINT_ID null} {CONSTRAINT_TYPE rel_constraint} {CONSTRAINT_NAME {}} {REL_SEGMENT {}} {REL_SIDE two} {REQUIRED_REL_SEGMENT {}} {CONTEXT_ID null} {CREATION_USER null} {CREATION_IP null}
      foreach var [list CONSTRAINT_ID CONSTRAINT_TYPE CONSTRAINT_NAME REL_SEGMENT REL_SIDE REQUIRED_REL_SEGMENT CONTEXT_ID CREATION_USER CREATION_IP]  {
        set varname [string tolower $var]
        if {[info exists $varname]} {
          set $var [set $varname]
          set _$var :$var
        } else {
          set _$var null
        }
      }
      set sql "
      select rel_constraint__new($_CONSTRAINT_ID$_CONSTRAINT_TYPE$_CONSTRAINT_NAME$_REL_SEGMENT$_REL_SIDE$_REQUIRED_REL_SEGMENT$_CONTEXT_ID$_CREATION_USER$_CREATION_IP) 
    "
      db_with_handle -dbn $dbn db {
        #ns_log notice "--sql=$sql"
        return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
      }
    }
::xo::db::sql::rel_constraint proc delete {{-dbn {}} -constraint_id:required} {
      #function_args: {CONSTRAINT_ID {}}
      foreach var [list CONSTRAINT_ID]  {
        set varname [string tolower $var]
        if {[info exists $varname]} {
          set $var [set $varname]
          set _$var :$var
        } else {
          set _$var null
        }
      }
      set sql "
      select rel_constraint__delete($_CONSTRAINT_ID) 
    "
      db_with_handle -dbn $dbn db {
        #ns_log notice "--sql=$sql"
        return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
      }
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: