Hi Efrain and Mark
I would like to request a small change on the csv import API. Its actaully the inclusion of a parameter to handle duplicates of records where you need to maintain a unique key .
For example a barcode. 2 different items should not have the same barcode. So its pretty easy to check for duplicates withing the livecode form and not allow the user to create a new record with a unique key, or ask them if they just want to update the record rather than create it
With the CSV import , it creates whatever records are in the CSV . Totally messes up your plans for keeping certain keys unique
So this is want I propose:
cdb_importCSV(pTable, pTarget, pPath, pUniqueKeys, pActionOnUnique)
The 2 new things will be : pUniqueKeys and pActionOnUnique
pActionOnUnique will be to either 'update' or 'ignore'
if it is 'ignore', then the import will disregard the duplicates
if it is ' update' it will update the keys of the existing records with whatever is in your csv
if you leave the parameter blank, then it does what the csv import usually does
pUniqueKeys will be the keys of whatever you don't want duplicated. For example "Barcode"
If a user uses the 2 extra parameters then please throw the Updated and Ignored records into 2 seperate arrays we can access, so we can inform the user what records have been ignored or what has been updated
This will be useful in a whole lot of scenarios , like importing data with ID numbers etc, you guys call them social security numbers, It is essential in accounting and stock software.
Thanks Guys
Sid
I would like to request a small change on the csv import API. Its actaully the inclusion of a parameter to handle duplicates of records where you need to maintain a unique key .
For example a barcode. 2 different items should not have the same barcode. So its pretty easy to check for duplicates withing the livecode form and not allow the user to create a new record with a unique key, or ask them if they just want to update the record rather than create it
With the CSV import , it creates whatever records are in the CSV . Totally messes up your plans for keeping certain keys unique
So this is want I propose:
cdb_importCSV(pTable, pTarget, pPath, pUniqueKeys, pActionOnUnique)
The 2 new things will be : pUniqueKeys and pActionOnUnique
pActionOnUnique will be to either 'update' or 'ignore'
if it is 'ignore', then the import will disregard the duplicates
if it is ' update' it will update the keys of the existing records with whatever is in your csv
if you leave the parameter blank, then it does what the csv import usually does
pUniqueKeys will be the keys of whatever you don't want duplicated. For example "Barcode"
If a user uses the 2 extra parameters then please throw the Updated and Ignored records into 2 seperate arrays we can access, so we can inform the user what records have been ignored or what has been updated
This will be useful in a whole lot of scenarios , like importing data with ID numbers etc, you guys call them social security numbers, It is essential in accounting and stock software.
Thanks Guys
Sid