command cdb_batchMerge pInputA


Summary

This command allows for the modification of a record key's value through comparisons like "is", "is not", "is in", and "is not in". This can be done across multiple keys across multiple records across multiple tables.

Inputs

BatchMerge input diagram

Additional Requirements

This API call requires internet access.

API Version

Examples

local tInputA, tClientsTableID, tOfficeTableID

#Table name: clients                                               #Table name: office
#keys: firstName, lastName, age, income                         #Keys: name, address
#Record: 
#[12345678-abcd-1234-cdef-1234567890ab]["firstName"] - "John"     #[45678123-abcd-1234-cdef-1234567890ab]["name"] - "Smith's Tech"
                                       ["lastName"] - "Smith"                                            ["address"] - "123 office Road"
                                       ["age"] - "47"
                                       ["income"] - "100000"


put cdb_getTableID("clients") into tClientsTableID                                       
put cdb_getTableID("office") into tOfficeTableID

##Update John's record
put "48" into tInputA[tClientsTableID]["12345678-abcd-1234-cdef-1234567890ab"]["age"]["value"]
put "is in" into tInputA[tClientsTableID]["12345678-abcd-1234-cdef-1234567890ab"]["age"]["operator"]

##Update Smith's Tech's record
put "road" into tInputA[tOfficeTableID]["45678123-abcd-1234-cdef-1234567890ab"]["address"]["value"]
put "is not in" into tInputA[tOfficeTableID]["45678123-abcd-1234-cdef-1234567890ab"]["address"]["operator"]
put " " into tInputA[tOfficeTableID]["45678123-abcd-1234-cdef-1234567890ab"]["address"]["delimiter"]

put "cloud" into tInputA["cdbTarget"]

cdb_batchMerge tInputA

#The tables now look like this:
#Table name: clients                                               #Table name: office
#[12345678-abcd-1234-cdef-1234567890ab]["firstName"] - "John"     #[45678123-abcd-1234-cdef-1234567890ab]["name"] - "Smith's Tech"
                                       ["lastName"] - "Smith"                                            ["address"] - "1234 office"
                                       ["age"] - "48"
                                       ["income"] - "100000"

```