xo::db::Object instproc update (public)

 <instance of xo::db::Object[i]> update [ -package_id package_id ] \
    [ -modifying_user modifying_user ] [ -context_id context_id ]

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

Update the current object in the database

Switches:
-package_id
(optional)
-modifying_user
(optional)
-context_id
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_xo_db_object test_xo_db_object (test xotcl-core) xo::db::Object instproc update xo::db::Object instproc update test_test_xo_db_object->xo::db::Object instproc update test_xotcl_core_tutorial_2 xotcl_core_tutorial_2 (test xotcl-core) test_xotcl_core_tutorial_2->xo::db::Object instproc update

Testcases:
xotcl_core_tutorial_2, test_xo_db_object
Source code:
set object_id ${:object_id}
if {![info exists package_id] && [info exists :package_id]} {
  set package_id ${:package_id}
}
if {![info exists context_id]} {
  set context_id [expr {[info exists :context_id] ? ${:context_id} : ""}]
}
[:info class] get_context package_id modifying_user modifying_ip
set title ${:object_title}
::xo::dc dml update_object {
  update acs_objects set
     title          = :title,
     modifying_user = :modifying_user,
     modifying_ip   = :modifying_ip,
     context_id     = :context_id
  where object_id = :object_id
}
# Make sure object memory image reflects db values
foreach att {modifying_user modifying_ip context_id} {
  set :${att} [set $att]
}
set :last_modified [::xo::dc get_value -prepare integer  get_last_modified {
  select last_modified from acs_objects
  where object_id = :object_id
}]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: