Storing hundreds of rows

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kolia
Posts: 82
Joined: Thu May 28, 2015 3:53 pm

Storing hundreds of rows

Post by kolia » Sun Aug 30, 2015 10:09 am

Hello
I need to import a CSV file that features several hundreds of rows a less that 10 columns in LC environment and make it persitent. This is a kind of read only database that does not need to be displayed. It needs to be queried to retrieve a row of data by code, so direct access to one specific row is needed based on two indexes. I have the feeling that SQLite would be too sophisticated for that kind of job. What would be the best approach?
From time to time,it may be needed to update this table.
Thank you
Nicolas
Nicolas
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Storing hundreds of rows

Post by Klaus » Sun Aug 30, 2015 1:01 pm

Hi Nicolas,

since FIELD objects have some overhead, better store the file/data in a custom property of the stack!
That will be stored with the stack.
...
set the cMiniDB of this stack to URL("file:"& "path/to/your/file.csv")
## cMiniDB is just a name, replace it with something more meaningful to you!
...
Then use it later:
...
put the cMiniDB of this stack into tDB
## process data here...
...
You get the picture.


Best

Klaus

kolia
Posts: 82
Joined: Thu May 28, 2015 3:53 pm

Re: Storing hundreds of rows

Post by kolia » Sun Aug 30, 2015 3:24 pm

Hi Klaus,
Thanks for the advise, I will go that path
All the best
Nicolas
Nicolas
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1

kolia
Posts: 82
Joined: Thu May 28, 2015 3:53 pm

Re: Storing hundreds of rows

Post by kolia » Sun Aug 30, 2015 3:49 pm

This is definitely the way to go. Thanks
Nicolas
Nicolas
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1

Post Reply