SQlite to Field formatting. HELP!

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
gioclone
Posts: 5
Joined: Tue May 08, 2018 4:22 am

SQlite to Field formatting. HELP!

Post by gioclone » Tue May 08, 2018 4:29 am

:cry: 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

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: SQlite to Field formatting. HELP!

Post by bogs » Tue May 08, 2018 4:42 am

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 ))
Image

gioclone
Posts: 5
Joined: Tue May 08, 2018 4:22 am

Re: SQlite to Field formatting. HELP!

Post by gioclone » Tue May 08, 2018 8:18 am

:(

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...

gioclone
Posts: 5
Joined: Tue May 08, 2018 4:22 am

Re: SQlite to Field formatting. HELP!

Post by gioclone » Tue May 08, 2018 8:26 am

know of any tutorial that can lead me on this?

AndyP
Posts: 614
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: SQlite to Field formatting. HELP!

Post by AndyP » 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
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

SparkOut
Posts: 2839
Joined: Sun Sep 23, 2007 4:58 pm

Re: SQlite to Field formatting. HELP!

Post by SparkOut » 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.

gioclone
Posts: 5
Joined: Tue May 08, 2018 4:22 am

Re: SQlite to Field formatting. HELP!

Post by gioclone » Wed May 09, 2018 3:46 am

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"

gioclone
Posts: 5
Joined: Tue May 08, 2018 4:22 am

Re: SQlite to Field formatting. HELP!

Post by gioclone » Wed May 09, 2018 3:48 am

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.

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: SQlite to Field formatting. HELP!

Post by MaxV » Tue May 15, 2018 1:07 am

use urlencode and urldecode: http://livecode.wikia.com/wiki/URLEncode
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”