SQLite DOT functions

Bob Sneidar bobsneidar at iotecdigital.com
Tue May 26 17:40:37 EDT 2015


Keep in mind though, that this will return the SQL used to create the table, NOT the optimum SQL or some standard SQL syntax for creating the table. This differs from mySQL in that mySQL will return the standard syntax for creating that particular table. 

This may seem like nitpicking, until you need to parse that SQL in which case you will find that you may not get the results you expect. I learned this because while I normally use a utility to create my tables, I have on occasion had need to programmatically create my tables, and the way I formatted the SQL was different enough from the way the utility did it that later when I went to parse it, I discovered my error. 

Bob S


> On May 25, 2015, at 12:18 , Mike Bonner <bonnmike at gmail.com> wrote:
> 
> get revdatafromquery(,,sDatabaseId,"select  sql  from sqlite_master where
> name='COMPANY'")
> 
> This will return the SQL to create the table as a row of returned data.
> 
> 
> SDatabaseId is of course the database connection id.
> 
> 
> On Mon, May 25, 2015 at 12:45 PM, Terence Heaford <t.heaford at icloud.com>
> wrote:
> 
>> How do you implement the following DOT function in LiveCode
>> 
>> sqlite>.schema COMPANY
>> 
>> 
>> CREATE TABLE COMPANY(
>>   ID INT PRIMARY KEY     NOT NULL,
>>   NAME           TEXT    NOT NULL,
>>   AGE            INT     NOT NULL,
>>   ADDRESS        CHAR(50),
>>   SALARY         REAL
>> );
>> 
>> 
>> 
>> Thanks
>> 
>> Terry
>> 
>> 
>> _______________________________________________
>> 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
>> 
> _______________________________________________
> 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