db.tables and conn:merge
what are
db.tables
andconn:merge
. how are VDBs used.A call to
conn:merge{}
will either insert new rows in a database table or update existing rows. This depends on how the VDB was configured, see Key Fields and Examples.If no key columns are defined, new rows are always inserted. Some applications prefer this behavior, since data is never overwritten.
If key columns are defined, Iguana performs a SELECT statement to attempt to find rows that match the values provided in the key columns. If a row exists, an UPDATE operation is performed. Otherwise, an INSERT is performed.
separate page on bulk inserts?
Bulk insert is an optional
bulk_insert
boolean flag forconn:merge{}
that can be used with Microsoft SQL Server and MySQL. It ignores the key columns defined in the VMD files and always does an INSERT using the bulk insert syntax. If your table has a large number of rows, this can improve performance.Note: Bulk insert does inserts only, if you need to do updates you must handle these separately. You will get an error if you try to merge a duplicate record.
db:merge does not support spaces in column names