Newbie SQLite and LC learing problems

Bob Sneidar bobs at twft.com
Fri Aug 24 13:02:33 EDT 2012


Hi Blair. I would search the web for sqLite syntax and sqLite primer. Tons of stuff out there. Be prepared for some kind of learning curve here, as SQL is like learning a new language, although not a very extensive one in the case of sqLite. 

Relationships are not what you would think coming from Filemaker. Relationships are created using Joins, and the data returned is not multiple cursors, but is actually a single cursor. It works, but it is not the parent-child pointer system you are used to. 

Livecode provides some basic commands and functions, one for connecting to a database (revOpenDatabase), one for getting data from a database as a string (RevDataFromQuery), one for getting data as a read only cursor (revQueryDatabase), one for executing a query that doesn't return any data at all, such as altering a table (revdb_execute) and of course one for closing a database (revCloseDatabase) all of which are described in the dictionary. 

Knowing all these will still not get you very far as you STILL have to learn how to form sql statements. There is however some good news! There are two utilities you can purchase, written by other livecode developers that for most queries eliminate the need to learn sql syntax! There is the new dbLib by Andre Garzia, and there is sqlYoga by Trevor Devore. Andre's is simpler to get started with. Trevor's is quite robust and covers just about anything you might want to do with an SQL database. 

Bob


On Aug 24, 2012, at 9:43 AM, Blair Lewis wrote:

> I'm new to LC and am I am looking for help with using DB's with LC. I am coming from Filemaker and I am unable to find a decent tutorial on how to use SQLite that is either complete or useful.
> 
> Does anyone have a sample stack and DB that I can pull apart to learn. I'm particularly having difficulty with creating relationships for creating and retrieving data combining multiple tables. Something about lastrow ID keeps coming up but I'm a little lost
> 
> Blair 





More information about the use-livecode mailing list