I have a table that contains a char(36) field for a uuid. It seems like I can insert data into that field with a mysql query like: INSERT INTO mytable (uid, event_guid) VALUES (1, uuid());
. I'd like to make a query like that in DBTNG syntax, but I believe I will just insert the string "uuid()" into the column.
db_insert('mytable')
->fields(array('uid' => $uid, 'event_guid' => 'uuid()'))
->execute();
So...do I just use db_query? Is there some magic in dbtng to handle this?
db_merge()
which does have that method – Clive♦ Dec 4 '12 at 0:30MergeQuery
class when the table needs to be updated, not to insert new data in the database. See MergeQuery::execute(), in particular the part afterif ($this->needsUpdate) {
. – kiamlaluno♦ Dec 4 '12 at 17:47