NAME
RunSqlEnter — Do an update if an entry exists or an insert if not.
SYNOPSIS
RunSqlEnter TableName WhereDict ?SetDict?
DESCRIPTION
Return Value
The id of the record just inserted or updated.
Arguments
TableNameTable to do insert/update on.
WhereDictDict containing column name / value pairs to search.
SetDictDict containing column name / value pairs to write. Optional (see below).
More Info
Note that for the dicts, you (currently) must put quotes around any values that will go into text columns or receive an error. We may add support in a future release for automatically detecting the column type and quoting values as necessary.

The SetDict argument may be omitted if the WhereDict covers all the relevant info. For instance, if entering into a table with just one column there is no point in having an additional dict.

Check this page for info about how to set up Gen for using database-related commands.


For information regarding exceptions / errors, see here.
EXAMPLES
% RunSqlCreate my_table {id {integer primary key} desc text notes text}
% QQ [SqlInsertStatement my_table {desc 'one' notes 'uno'}]
% RunSqlEnter my_table {desc 'one'} {notes '1-2-3'}
% QQ [SqlSelectStatement my_table]
one 1-2-3
SEE ALSO
RunSqlInsertIfDoesNotExist, SqlCountStatement, SqlInsertStatement, SqlUpdateStatement, SqlWhereClause
KEYWORDS
sql