xo::db::sql::image proc new (public)
xo::db::sql::image new [ -dbn dbn ] -name name \ [ -parent_id parent_id ] [ -item_id item_id ] \ [ -revision_id revision_id ] [ -mime_type mime_type ] \ [ -creation_user creation_user ] [ -creation_ip creation_ip ] \ [ -relation_tag relation_tag ] [ -title title ] \ [ -description description ] [ -is_live is_live ] \ [ -publish_date publish_date ] -path path -file_size file_size \ -height height -width width [ -package_id package_id ] \ [ -childof childof ]
Defined in /var/www/openacs.org/packages/xotcl-core/tcl/05-db-procs.tcl
Automatically generated method
- Switches:
- -dbn (optional)
- -name (required)
- -parent_id (optional)
- -item_id (optional)
- -revision_id (optional)
- -mime_type (optional, defaults to
"jpeg"
)- -creation_user (optional)
- -creation_ip (optional)
- -relation_tag (optional)
- -title (optional)
- -description (optional)
- -is_live (optional, defaults to
"f"
)- -publish_date (optional, defaults to
"now()"
)- -path (required)
- -file_size (required)
- -height (required)
- -width (required)
- -package_id (optional)
- -childof (optional)
- Testcases:
- No testcase defined.
Source code: #function_args: {NAME {}} {PARENT_ID null} {ITEM_ID null} {REVISION_ID null} {MIME_TYPE jpeg} {CREATION_USER null} {CREATION_IP null} {RELATION_TAG null} {TITLE null} {DESCRIPTION null} {IS_LIVE f} {PUBLISH_DATE now()} {PATH {}} {FILE_SIZE {}} {HEIGHT {}} {WIDTH {}} {PACKAGE_ID null} foreach var [list NAME PARENT_ID ITEM_ID REVISION_ID MIME_TYPE CREATION_USER CREATION_IP RELATION_TAG TITLE DESCRIPTION IS_LIVE PUBLISH_DATE PATH FILE_SIZE HEIGHT WIDTH PACKAGE_ID] { set varname [string tolower $var] if {[info exists $varname]} { set $var [set $varname] set _$var :$var } else { set _$var null } } set sql " select image__new($_NAME, $_PARENT_ID, $_ITEM_ID, $_REVISION_ID, $_MIME_TYPE, $_CREATION_USER, $_CREATION_IP, $_RELATION_TAG, $_TITLE, $_DESCRIPTION, $_IS_LIVE, $_PUBLISH_DATE, $_PATH, $_FILE_SIZE, $_HEIGHT, $_WIDTH, $_PACKAGE_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