lundi 29 février 2016

How to check SQLite table is empty or not in Swift

I am using FMDB. I need a function which tells that table is empty or not I tried this. My table is Empty but it writing SomeData

 var count = shoppingPad.executeStatements("SELECT COUNT(*) FROM myTable")


            print("Count",count)
            if(!count )
            {
               print("EMpty Table")
            }
            else
            {
                print("SomeData")
            }

Aucun commentaire:

Enregistrer un commentaire