Page 1 of 1
SQlite to Field formatting. HELP!
Posted: Tue May 08, 2018 4:29 am
by gioclone

So here i am, trying my first SQLite app. I am writing a reader for existing databases. I am using the sample to guide me through the syntax.
I got it to open the database but when it imports the database it makes a mess of the text when ever it finds an accent or any character that is extended.
Thank you for your help.
I come from VB, RealBasic, js, etc.
Thanks for your help
Re: SQlite to Field formatting. HELP!
Posted: Tue May 08, 2018 4:42 am
by bogs
Just a guess here, but had a similar issue recently. When your pulling the information, you want to make sure your not pulling tabs, commas, apostrophes, etc. which was solved with
this formatting of the request-
Code: Select all
// the column in the db is Summary, and it contained tabs, returns, etc.
// although not strictly necessary, I also wrapped the column name with ` `...
REPLACE(`Summary`,X'09',CAST( ' ' as text ))
Re: SQlite to Field formatting. HELP!
Posted: Tue May 08, 2018 8:18 am
by gioclone
Honestly, I am trying to wrap my head around lc.
So what I am working on is a Bible program to use as a tool for research im doing.
I am using different versions and some of the databases include characters which look horribly formatted in LiveCode but the SQL browser displays it right.
And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day.<RF>And the evening…: Heb. And the evening was, and the morning was<Rf><CM>
And so on. I need anything in <RF> not to show.
Thank you in advance for your help...
Re: SQlite to Field formatting. HELP!
Posted: Tue May 08, 2018 8:26 am
by gioclone
know of any tutorial that can lead me on this?
Re: SQlite to Field formatting. HELP!
Posted: Tue May 08, 2018 8:33 am
by AndyP
This sounds like a Unicode problem.
try this on the result returned from the db query (textReturned)
Code: Select all
put textDecode(textReturned,"UTF8") into textReturned
Re: SQlite to Field formatting. HELP!
Posted: Tue May 08, 2018 2:07 pm
by SparkOut
<RF> tags in db could be request filter stored procedures.
To strip those there will be a one-liner replacetext regex. I am out using phone atm, otherwise I would play and test but it should be easy to eliminate stuff between the tags.
Re: SQlite to Field formatting. HELP!
Posted: Wed May 09, 2018 3:46 am
by gioclone
AndyP wrote: ↑Tue May 08, 2018 8:33 am
This sounds like a Unicode problem.
try this on the result returned from the db query (textReturned)
Code: Select all
put textDecode(textReturned,"UTF8") into textReturned
Very kind!
This is what I did, it worked but is that okay?
put databaseGetContactDetails() into textReturned
put textDecode(textReturned,"UTF8") into textReturned
put textReturned into field "Verse"
Re: SQlite to Field formatting. HELP!
Posted: Wed May 09, 2018 3:48 am
by gioclone
SparkOut wrote: ↑Tue May 08, 2018 2:07 pm
<RF> tags in db could be request filter stored procedures.
To strip those there will be a one-liner replacetext regex. I am out using phone atm, otherwise I would play and test but it should be easy to eliminate stuff between the tags.
Would love to see that being used...
I will have to use regex a lot in this context so your help would be awesome.
Re: SQlite to Field formatting. HELP!
Posted: Tue May 15, 2018 1:07 am
by MaxV