You can use simple wrapper like as

proc ::dataset::update {table fields} {
        array set info $fields
        foreach {key value} $fields {
                if {$key eq {id}} continue
                if {$key eq {*}} continue
                lappend sql_pairs $key=:info($key)
        }
        set sql_pairs [join $sql_pairs ,]
        set query "update $table set $sql_pairs where id=$info(id)"
        db eval $query
}


2010/5/30 Ross Hayden <[email protected]>:
> If SQLite can return to me a Tcl array from SELECT, why does the feature not
> exist to INSERT, UPDATE, or DELETE using a properly formed Tcl array as an
> argument?
>
> Seems nice to have, but perhaps I'm not aware of possible dangers in such a
> feature.

-- 
Best regards, Alexey Pechnikov.
http://pechnikov.tel/
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to