Showing posts with label Flex Mobile. Show all posts
Showing posts with label Flex Mobile. Show all posts

Sunday, January 22, 2012

Flex Adobe Air SQLite search query syntax

Adobe AIR does not support SQLite FTS.

To search for particular rows using WHERE & LIKE

SELECT * FROM tablename WHERE columnname LIKE :columnname"

:columnname holds the value "%somevalue%

Below are the few syntax for SQLite & Adobe AIR

Table Creation

CREATE TABLE IF NOT EXISTS tablename (id INTEGER PRIMARY KEY AUTOINCREMENT, column1 TEXT NOT NULL, column2 TEXT, column3 TEXT, columndate DATE)

Selecting rows using WHERE

SELECT * FROM tablename WHERE columnname = "somevalue" 

SQLite Date Comparison

SELECT * FROM tablename WHERE date(columndate) = date("somevalue") 

SQLite Multiple WHERE conditions

SELECT * FROM tablename WHERE columnname = "somevalue" AND columnname2 = "somevalue" 

SQLite INSERTing rows

INSERT INTO tablename (column1, column2, column3, column4) VALUES ( "somevalue", "somevalue", "somevalue", "somevalue" ) 

SQLite INSERTing multiple rows at once

INSERT INTO tablename (column1, column2, column3, column4) SELECT 'somevalue', 'somevalue', 'somevalue', 'somevalue' UNION SELECT 'somevalue', 'somevalue', 'somevalue', 'somevalue'

Wednesday, September 7, 2011

Flex mobile shared object data storage

If you are developing a mobile application & you might want to store the data globally so that you can access from the different views.

Using PersistenceManager we can achieve this. We can use the PersistenceManager which stores the data by using key value.


var persistenceManager:PersistenceManager = new PersistenceManager();
persistenceManager.setProperty("dataURL","http://google.com");
persistenceManager.getProperty("dataURL");
Related Posts Plugin for WordPress, Blogger...