xo::db::sql::content_item proc set_live_revision (public)

 xo::db::sql::content_item[i] set_live_revision [ -dbn dbn ] \
    -revision_id revision_id  [ -publish_status publish_status ] \
    [ -publish_date publish_date ] [ -is_latest is_latest ]

Defined in /var/www/openacs.org/packages/xotcl-core/tcl/05-db-procs.tcl

Automatically generated method

Switches:
-dbn (optional)
-revision_id (required)
-publish_status (optional, defaults to "ready")
-publish_date (optional, defaults to "now()")
-is_latest (optional, defaults to "f")

Testcases:
xotcl_core_tutorial_4
Source code:
#function_args: {REVISION_ID {}} {PUBLISH_STATUS ready} {PUBLISH_DATE now()} {IS_LATEST f}
foreach var [list REVISION_ID PUBLISH_STATUS PUBLISH_DATE IS_LATEST]  {
  set varname [string tolower $var]
  if {[info exists $varname]} {
    set $var [set $varname]
    set _$var :$var
  } else {
    set _$var null
  }
}
set sql "
select content_item__set_live_revision($_REVISION_ID$_PUBLISH_STATUS$_PUBLISH_DATE$_IS_LATEST) FOR NO KEY UPDATE
    "
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: