Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

db.tables and conn:merge

  1. what are db.tables and conn:merge. how are VDBs used.

  2. 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.

    1. If no key columns are defined, new rows are always inserted. Some applications prefer this behavior, since data is never overwritten.

    2. 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.

  3. separate page on bulk inserts?

    1. Bulk insert is an optional bulk_insert boolean flag for conn: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.

  4. db:merge does not support spaces in column names

    1. custom_merge.lua https://help.interfaceware.com/v6/customize-custom_merge-lua-for-table-and-field-names-with-spaces

  • No labels