Stuck on native database functions

Terence Heaford lheaford at icloud.com
Wed Jul 7 11:40:33 EDT 2021


Mark, it certainly helps me.

The routine I have working is

put "uniqueID,date,type,description,amount,balance,category" into tFields

put merge("INSERT INTO [[tAccountName]] ([[tFields]]) VALUES(:1,:2,:3,:4,:5,:6,:7)") into tSQL

revExecuteSQL dbGetID(), tSQL, "tValues[uniqueID]", "tValues[date]", "tValues[type]", "tValues[description]", "tValues[amount]", "tValues[balance]","tValues[category]"

put the result into tErr

return tErr


It resolves the error I was getting relating to autoincrement.

Thanks

Terry


> On 7 Jul 2021, at 11:29, Mark Smith via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Currently I have this working
> 
> (Content of tSQL :)
> INSERT into TABLE1 ("complete", "todo", "itemDate", "category", "purgeDate", "dgOrder") values(:1, :2, :3, :4, :5, :6)
> 
> 
> revExecuteSQL gConnectID, tSQL, "ptheRowA[complete]", "ptheRowA[todo]", "ptheRowA[itemDate]", "ptheRowA[category]", "ptheRowA[purgeDate]", "ptheRowA[dgOrder]”
> 
> I am not passing the entire array because there are some array elements that I am not saving. If I did want to save/insert the whole array then I would write something like:
> 
> revExecuteSQL gConnectID, tSQL, “ptheRowA”
> 
> Hope that helps,
> Mark




More information about the use-livecode mailing list