Storing and retrieving data from a SQL database

Paul Dupuis paul at
Sat May 21 03:33:02 CEST 2016

Apparently, you either DO need to escape certain characters even when
using parametrized queries.

I have the code below: I pass it an array where the description
pArray[7] contains several lines of text from a field and the second
line contains a tab

command updateInDatabase pArray 
  put the databaseID of this stack into tDatabaseID
  put "UPDATE mytable SET
name=:2,type=:3,topic=:4,subtopic=:5,duration=:6,description=:7,source=:8 WHERE
id=:1" into tQuery
  revExecuteSQL tDatabaseID,tQuery,"pArray"
  get the result
  if it is not a number then
    -- error
    put it
    -- number of rows changed
  end if
end updateInDatabase

This executes and indicates a row was update in the database and a
direct check of the SQLite database shows that columns were updated
EXCEPT for description where any content that was in pArray[7] AFTER and
including the TAB is missing. So apparently TABs can not be included in
data passed by parameters.

OR is this a LiveCode 8 bug?

More information about the use-livecode mailing list