Assigning an int64 to a table in sqlite

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Assigning an int64 to a table in sqlite

Post by sandy771 » Thu 20 May 2010 13:11

I need to populate a table with some large integer values.

the fields in the dsqlite database are defined as UNSIGNED BIG INT

Before I converted my code to sqlite I assigned the data ->AsVariant and all worked OK and the numbers displayed correctly in my grid (DevExpress QuantumGrid).

sqlite does not support the ->asVariant method so I have tried ->asInteger. When I do this my integers are rounded down and a load of them are displayed as -ve values.

How can I assign a largeint to sqlite using TuniTable?

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Thu 20 May 2010 14:38

Hello

Thank you for the information. UNSIGNED BIG INT data type currently is not supported. We will add support of this data type in one of the next builds of UniDAC. Currently you can use BIGINT data type to store big integer values.

sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Post by sandy771 » Thu 20 May 2010 15:14

Thanks Bork

I have changed my code to BIG INT, but when I load the table and view in my grid the larger numbers are still truncated to 32 bit.

Is there anyway of loading a 64 bit number into SQlite?

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Fri 21 May 2010 08:42

According to SQLite documentation (http://www.sqlite.org/datatype3.html) database has the following data types:
- INT
- INTEGER
- TINYINT
- SMALLINT
- MEDIUMINT
- BIGINT
- UNSIGNED BIG INT
- INT2
- INT8
The BIG INT (with space) data type is not present in this list and UniDAC components equate it to Integer. We make the BIG INT data type similar to the BIGINT data type in one of the next builds of UniDAC. But now you should change the field data type from BIG INT to BIGINT. Also if any columns were created in the run-time then please remove them and create again. Columns with data type BIGINT will be created as TLargeintField.

sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Post by sandy771 » Fri 21 May 2010 09:48

That worked - Thank You.

Post Reply