Stuck on native database functions
Terence Heaford
lheaford at icloud.com
Wed Jul 7 02:52:59 EDT 2021
Here’s an example I have been using, not sure whether it will help:
function dbAddTransaction tAccountName,tValues
put q(tAccountName) into tAccountName
put q(tValues["uniqueID"]) into tUniqueID
put q(tValues["date"]) into tDate
put q(tValues["type"]) into tType
put q(tValues["description"]) into tDescription
put q(tValues["amount"]) into tAmount
put q(tValues["balance"]) into tBalance
put q(tValues["category"]) into tCategory
put "uniqueID,date,type,description,amount,balance,category" into tFields
put merge("[[tUniqueID]],[[tDate]],[[tType]],[[tDescription]],[[tAmount]],[[tBalance]],[[tCategory]]")into tValues
put merge("INSERT INTO [[tAccountName]] ([[tFields]]) VALUES([[tValues]])") into tSQL
revExecuteSQL dbGetID(), tSQL
put the result into tErr
return tErr
end dbAddTransaction
-------------------------
function dbEscapeSqlite tText
replace "'" with "''" in tText
return tText
end dbEscapeSqlite
-------------------
function q tText
return "'" & dbEscapeSqlite(tText) & "'"
end q
-------------------
> On 7 Jul 2021, at 00:06, Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> Hi all.
>
> I assemble an SQL statement that looks like this:
>
> insert into ObjectProperties (recordid,rect,controlname,owner,visible) VALUES (:1,:2,:3,:4,:5)
>
> I then execute this statement:
>
> revExecuteSQL tDBID, tInsertSQL, aRecordData
>
> I get records but with no data in them. I checked aRecordData and it has all 5 columns as keys and data in each of them.
>
> I am at a complete loss. I was sure this was working before, now it is not.
>
> Bob S
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list