xo::db::sql::content_type proc register_child_type (public)

 xo::db::sql::content_type[i] register_child_type [ -dbn dbn ] \
    -parent_type parent_type  -child_type child_type  \
    [ -relation_tag relation_tag ] [ -min_n min_n ] [ -max_n max_n ]

Defined in packages/xotcl-core/tcl/05-db-procs.tcl

Automatically generated method

Switches:
-dbn
(optional)
-parent_type
(required)
-child_type
(required)
-relation_tag
(defaults to "generic") (optional)
-min_n
(defaults to "0") (optional)
-max_n
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 db_with_handle db_with_handle (public) xo::db::sql::content_type proc register_child_type xo::db::sql::content_type proc register_child_type xo::db::sql::content_type proc register_child_type->db_with_handle

Testcases:
No testcase defined.
Source code:
#function_args: {PARENT_TYPE {}} {CHILD_TYPE {}} {RELATION_TAG generic} {MIN_N 0} {MAX_N null}
foreach var [list PARENT_TYPE CHILD_TYPE RELATION_TAG MIN_N MAX_N]  {
  set varname [string tolower $var]
  if {[info exists $varname]} {
    set $var [set $varname]
    set _$var :$var
  } else {
    set _$var null
  }
}
set sql "
select content_type__register_child_type($_PARENT_TYPE$_CHILD_TYPE$_RELATION_TAG$_MIN_N$_MAX_N) 
    "
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: