Storing and retrieving data from a SQL database

Peter Haworth pete at lcsql.com
Fri May 20 22:38:33 EDT 2016


Tabs shouldn't be a problem so I suspect something else.

Have you tried using LC to select the data after updating it?  As mentioned
in an earlier post, if you use revDataFromQuery to do the SELECT, be sure
to use something other than tab/return for the column/row delimiters.

I'm wondering if whatever program you used to "directly check" the data has
a problem with the tabs (fingers crossed it wasn't SQLiteAdmin!).

Pete

On Fri, May 20, 2016 at 6:33 PM Paul Dupuis <paul at researchware.com> wrote:

> 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
>   --
>
> pArray[1]=ID,[2]=Name,[3]=Type,[4]=Topic,[5]=Subtopic,[6]=Duration,[7]=Description,[8]=Source
>   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
>   else
>     -- 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?
>
> _______________________________________________
> 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