AxWald - nice handlers. Might need to take account of single digit day and month numbers unless you always force them to have leading zeros internally.
Definitely in favor of using strftime in your SELECT statements, make SQLite do the work for you instead of writing LC code to do it.
Pete
Search found 587 matches
- Sat Mar 05, 2016 6:12 pm
- Forum: Databases
- Topic: Insert into data comma separated decimals
- Replies: 11
- Views: 7687
- Fri Mar 04, 2016 8:01 pm
- Forum: Databases
- Topic: Insert into data comma separated decimals
- Replies: 11
- Views: 7687
Re: Insert into data comma separated decimals
You'll have to be careful when SELECTing your data since the default separator for the columns in revDataFromQuery is a comma so your 12,5 will look like two columns in the data coming back from revDataFromQuery. Fortunately, you can specify the column delimiter to use in revDataFromQuery: put revDa...
- Sun Feb 28, 2016 8:22 pm
- Forum: Getting Started with LiveCode - Experienced Developers
- Topic: Storing date to a database, retrieving it and displaying it
- Replies: 5
- Views: 4047
Re: Storing date to a database, retrieving it and displaying
Wondering why you are not using the standard sql date format of YYYY-MM-DD?
- Fri Feb 26, 2016 8:03 pm
- Forum: Databases
- Topic: format Long SQL query
- Replies: 11
- Views: 8486
Re: format Long SQL query
As Adrian noted, the answer to whether to execute the queries on the server depends on a lot of things. How sensitive is your data? Do you care if your database gets hacked via SQL injection? And many others. The simplest thing you can do to protect your security is to to use the variables list para...
- Mon Feb 22, 2016 7:33 pm
- Forum: Databases
- Topic: format Long SQL query
- Replies: 11
- Views: 8486
Re: format Long SQL query
Don;t think you can format it in exactly the way you want it but one way to make the code more readable is to break thew SQL statement into a series of constants and string them together to create the complete statement. For example; constant kSelect="Select Inventory.PLU_Number,Inventory.Plu_Descri...
- Tue Feb 02, 2016 7:29 pm
- Forum: Databases
- Topic: Basic MySQL Query
- Replies: 5
- Views: 4777
Re: Basic MySQL Query
I'd like to suggest one small but significant change to this. Change the code: put "SELECT MessageP FROM Proxic WHERE NameP='what i''m looking for';" into tSQL put revDataFromQuery(tab, return, gConnectionID, tSQL) into tData to: put "what I'm looking for" into tSearch put "SELECT MessageP FROM Prox...
- Sat Jan 16, 2016 8:05 pm
- Forum: Getting Started with LiveCode - Complete Beginners
- Topic: [ANN] lcStackBrowser v2.2.2 Released
- Replies: 0
- Views: 1963
[ANN] lcStackBrowser v2.2.2 Released
Version 2.2.2 of lcStackBrowser, a plugin replacement for the Livecode Application and Project Browser, is now available. This is mainly a bug fix release with a couple of minor enhancements, detailed in the release notes at https://goo.gl/DGUg65. This is a free update for existing users. A 30-day, ...
- Thu Jan 14, 2016 12:33 am
- Forum: Databases
- Topic: Populating SQLite Db in iOS from CSV file?
- Replies: 7
- Views: 5383
Re: Populating SQLite Db in iOS from CSV file?
Yes, those are the ones.
Pete
Pete
- Wed Jan 13, 2016 8:23 pm
- Forum: Databases
- Topic: Populating SQLite Db in iOS from CSV file?
- Replies: 7
- Views: 5383
Re: Populating SQLite Db in iOS from CSV file?
The SQL side of this is easy, with the caveat that you should use the variableslist/arrayname parameter of revExecuteSQL so you don't have to worry about escaping quotes. Can't help much with how to download the csv file if you mean you want to do it programmatically. To parse the csv file, the only...
- Mon Dec 28, 2015 8:13 pm
- Forum: Getting Started with LiveCode - Complete Beginners
- Topic: MySQL Phrasing
- Replies: 3
- Views: 2239
Re: MySQL Phrasing
The SQL to delete all rows from a table is: DELETE FROM <tablename> The absence of the WHERE clause indicates all rows are to be deleted. So your LC code would be: revExecuteSQL gConnectionID,"DELETE FROM MessagesP" if the result is not an integer then <insert your error handling here> end if If you...
- Sun Dec 06, 2015 1:55 am
- Forum: Databases
- Topic: Save edited list back to the DB - SQLite
- Replies: 9
- Views: 6643
Re: Save edited list back to the DB - SQLite
Sequence should be:
BEGIN
INSERT
If error then ROLLBACK and exit
UPDATE
If error then ROLLBACK and exit
COMMIT
BEGIN
INSERT
If error then ROLLBACK and exit
UPDATE
If error then ROLLBACK and exit
COMMIT
- Tue Nov 03, 2015 1:59 am
- Forum: Getting Started with LiveCode - Complete Beginners
- Topic: [ANN] Vrrsion 2.2.1 of lcStackBrowser Released
- Replies: 0
- Views: 1875
[ANN] Vrrsion 2.2.1 of lcStackBrowser Released
I'm pleased to announce the release of lcStackBrowser v2.2.1,a plugin replacement for the Livecode Application Browser, Project Browser, Property Inspector, and Tools palette. This is a free update for existing users. A free 30-day trial version is available at http://www.lcsql.com/lcstackbrowser.ht...
- Wed Oct 21, 2015 8:58 pm
- Forum: Getting Started with LiveCode - Complete Beginners
- Topic: [ANN] lcStackBrowser v 2.2.0 Released
- Replies: 2
- Views: 2117
[ANN] lcStackBrowser v 2.2.0 Released
I'm pleased to announce the availability of version 2.2.0 of lcStackbrowser, a plugin replacement for the Livecode Application Browser and Project Browser. This is a free update for all existing users. A demo version is available at http://www.lcsql.com/lcstackbrowser.html. This release includes the...
- Sun Oct 18, 2015 12:40 am
- Forum: Getting Started with LiveCode - Experienced Developers
- Topic: "new" JSON library fastJson
- Replies: 62
- Views: 39128
Re: "new" JSON library fastJson
You know that happened to me too but I thought it was a factor of what else was happening on my computer at the time. I have a test stack of my own that I used to figure out how to get what I need from the dictionary so I just went back and rant a few times and sure enough, it takes about 3 times as...
- Sat Oct 17, 2015 5:53 pm
- Forum: Getting Started with LiveCode - Experienced Developers
- Topic: "new" JSON library fastJson
- Replies: 62
- Views: 39128
Re: "new" JSON library fastJson
After successfully parsing the dictionary file, I was prowling around the array and came across jsonImport and jsonExport as part of a JSON library which looks like it was introduced in LC8. Out of curiosity, I used jsonImport to parse the dictionary file. It looks like it produced the same results ...