martinrybak / SQLClient

Native Microsoft SQL Server client for iOS
http://objcsharp.wordpress.com/2013/10/15/an-open-source-sql-server-library-for-ios/
MIT License
124 stars 51 forks source link

swift programming result in getting only one digit of Integer number #49

Closed whencesoever closed 7 years ago

whencesoever commented 7 years ago

This code result in only one digit being returnem from sql server in column.value. Is there and error in my swift understanding or something with library?

override func viewDidLoad() {
            super.viewDidLoad()

            let client = SQLClient.sharedInstance()

            client?.connect(Constants.serwerAdress, username: Constants.userName, password: Constants.password, database: Constants.databaseName) {
                success in

                if success {
                    client?.execute("select A FROM B") {
                        results in

                        for table in results as AnyObject! as! NSArray {
                            for row in table as AnyObject! as! NSArray {

                                for column in row as! NSDictionary {

                                    print("\(column.key) = \(column.value)")
                                }
                            }
                        }
                        client?.disconnect()
                        DoSomethingElse()
                    }
                }
            }

        }
whencesoever commented 7 years ago

when debugging SQLClient.m i found an error: Data conversion resulted in overflow

martinrybak commented 7 years ago

Please try the types branch. Lots of data conversion updates there.

whencesoever commented 7 years ago

types worked for me, thank you