• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Primary Key (cdbRecordId)
#4
Hi again Efrain,
Thank you for the example - that certainly works.

I don't seem to be able to modify the cdbRecordID however?
I recently used the import -> csv function in LCM to bulk import some tables from an SQL project where primary/foreign keys were already defined in UUID format.
As you know, i wasn't able to import the existing primary keys into the cdbRecordID key as that isn't supported during csv import, so I uploaded them to a new key called primaryKey
I was hoping to modify the cdb[cdbRecordID] key to match the primaryKey, but it just seems to fail silently. 

I'm not sure if it's my code or if this isn't permitted by LiveCloud...
Here's the code: 
Code:
on mouseUp pButtonNumber
   local tTableDataA, tDataA, tTarget, tTableName, tID
  
   put "dashboard" into tTableName
   put "cloud" into tTarget
  
   put cdb_read("dashboard", "*", "cloud") into tTableDataA                                  
  
   repeat for each element tElement in tTableDataA
      put tElement["primaryKey"] into tDataA["cdb"]["cdbRecordID"]
      put tElement["cdb"]["cdbRecordID"] into tID
      
      cdb_update tDataA,tTableName,tID, tTarget
   end repeat
  
end mouseUp

Am i doing something majorly wrong or is this operation not permitted?
(i also tried this with batchMerge but got the message 'illegal key' -- but this doesn't seem to happen with update)
Many thanks!
  Reply


Messages In This Thread
Primary Key (cdbRecordId) - by stamatis - 08-23-2020, 11:02 AM
RE: Primary Key (cdbRecordId) - by mark_talluto - 08-23-2020, 08:24 PM
RE: Primary Key (cdbRecordId) - by efrain.c - 08-24-2020, 04:24 PM
RE: Primary Key (cdbRecordId) - by stamatis - 10-19-2020, 02:36 AM
RE: Primary Key (cdbRecordId) - by efrain.c - 10-19-2020, 08:55 PM
RE: Primary Key (cdbRecordId) - by stamatis - 10-20-2020, 01:12 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)