user1620044
user1620044

Reputation: 1

Flash Builder Mobile 4.5 - Populate a list with data sqlite

`

<fx:Script>
    <![CDATA[
        import mx.collections.ArrayCollection;
        import spark.events.ViewNavigatorEvent;     

        protected var sqlConnection:SQLConnection;

        protected function view1_viewActivateHandler(event:ViewNavigatorEvent):void
        {
            sqlConnection = new SQLConnection();
            sqlConnection.open(File.applicationStorageDirectory.resolvePath("euro.db"));
            getAllGiberish();
        }

        protected function getAllGiberish():void
        {
            var stmt:SQLStatement = new SQLStatement();
            stmt.sqlConnection = sqlConnection;
            stmt.text = "SELECT esteso FROM generale GROUP BY nazione, esteso HAVING nazione = 'Austria'";
            stmt.execute();
            list.dataProvider = new ArrayCollection(stmt.getResult().data);         
        }       

    ]]>

</fx:Script>

<s:List id="list" x="4" y="5" width="306" height="274" />

because I do not get any data in the list? What did I do wrong? I have 4 fields in the generale table id, valore, moneta, esteso

Upvotes: 0

Views: 404

Answers (1)

Jacko
Jacko

Reputation: 76

I am no expert but I first thought the SQL statement may be malformed, HAVING I thought was used for aggregate functions, so would

SELECT esteso FROM generale WHERE nazione = 'Austria' GROUP BY nazione, esteso;

Although I just noticed this is from Aug 23 and you probably have sorted it already.

Jacko

Upvotes: 1

Related Questions