Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Drago, William @ MWG - NARDAEAST
I'm willing to bet that the problem is in your C# code. The variable receiving 
the INTEGER column is probably declared as an INT instead of LONG or ULONG.

-Bill

> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of Werner Kleiner
> Sent: Thursday, May 15, 2014 7:08 AM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] SQLite Datareader problems with Int?
>
> Simon Slavin-3 wrote
> >  There is no need to do anything special.  f you use 'Int' in SQLite
> > it will be interpreted as 'INTEGER' anyway.
>
> Yes, but back to my datareader problem it seems that the Datareader
> differs between a column which is 'INTEGER' or 'Int'.
> Especially we had a problem with a Int column and value of 13 digits
> (1396856032225). The datareader reads the column as a integer 32 value
> and breaks or returns wrong values. (or we do something wrong :-) )
>
>
>
>
> --
> View this message in context:
> http://sqlite.1065341.n5.nabble.com/SQLite-Datareader-problems-with-
> Int-tp75670p75684.html
> Sent from the SQLite mailing list archive at Nabble.com.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any 
attachments are solely for the use of the addressee and may contain information 
that is privileged or confidential. Any disclosure, use or distribution of the 
information contained herein is prohibited. In the event this e-mail contains 
technical data within the definition of the International Traffic in Arms 
Regulations or Export Administration Regulations, it is subject to the export 
control laws of the U.S.Government. The recipient should check this e-mail and 
any attachments for the presence of viruses as L-3 does not accept any 
liability associated with the transmission of this e-mail. If you have received 
this communication in error, please notify the sender by reply e-mail and 
immediately delete this message and any attachments.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Simon Slavin

On 15 May 2014, at 12:53pm, Werner Kleiner  wrote:

> What we use is this:
> 
> System.Data.SQLite
> System.Data.SQLite Download Page
> 
> http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki
> 
> And this is not part of SQLite?

Not really.  As the page says

"System.Data.SQLite is an ADO.NET provider for SQLite."

It is not SQLite itself.  However, there are people here who know about 
System.Data.SQLite, so you may be able to get a good answer to your problem if 
you wait a while.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Werner Kleiner


What we use is this:

System.Data.SQLite
System.Data.SQLite Download Page

http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki

And this is not part of SQLite?



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/SQLite-Datareader-problems-with-Int-tp75670p75686.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Simon Slavin

On 15 May 2014, at 12:08pm, Werner Kleiner  wrote:

> Simon Slavin-3 wrote
>> There is no need to do anything special.  f you use 'Int' in SQLite it
>> will be interpreted as 'INTEGER' anyway.  
> 
> Yes, but back to my datareader problem it seems that the Datareader differs
> between a column which is 'INTEGER' or 'Int'. 
> Especially we had a problem with a Int column and value of 13 digits
> (1396856032225). The datareader reads the column as a integer 32 value and
> breaks or returns wrong values. (or we do something wrong :-) )

It is incorrect to assume a SQLite INTEGER can fit in a 32-bit variable.  The 
bug is in your datareader.  The datareader is not part of SQLite so you do not 
have a problem with SQLite.

Perhaps you could something else rather than datareader or store your numbers 
as text.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Werner Kleiner
Simon Slavin-3 wrote
>  There is no need to do anything special.  f you use 'Int' in SQLite it
> will be interpreted as 'INTEGER' anyway.  

Yes, but back to my datareader problem it seems that the Datareader differs
between a column which is 'INTEGER' or 'Int'. 
Especially we had a problem with a Int column and value of 13 digits
(1396856032225). The datareader reads the column as a integer 32 value and
breaks or returns wrong values. (or we do something wrong :-) )




--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/SQLite-Datareader-problems-with-Int-tp75670p75684.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Simon Slavin

On 15 May 2014, at 7:22am, Werner Kleiner  wrote:

> What I mean is: The original MySQL DB has columns with int(10). And the
> converting tool converts all these columns in SQLite to Int 
> I can change the conversion so that all columns would be INTEGER in SQLite.
> As I understand for SQLite it is equal if the column is declared as Int or
> INTEGER?

Sorry, now I understand your question.  There is no need to do anything 
special.  f you use 'Int' in SQLite it will be interpreted as 'INTEGER' anyway. 
 See the table in section 2.2 of this document:



Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Richard Hipp
On Thu, May 15, 2014 at 3:23 AM, Stephen Chrzanowski wrote:

> Technically, SQLite thinks STRING = INTEGER as far as field definitions are
> concerned, but either int or integer will do the job.
>

Not so.  Please see http://www.sqlite.org/datatype3.html#affinity

SQLite version 2 stored all values as strings.  But SQLite now stores
integers as integers and floats as floats and has done so for ten years.


-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread RSmith
Integer and Int is equivalent in SQLite indeed, except in primary keys - where if you declare a primary key as INTEGER PRIMARY KEY 
it becomes an alias for the rowid, and INT PRIMARY KEY is a normal Integer primary key but distinct from the rowid. In all other 
cases they mean the same.



On 2014/05/15 08:22, Werner Kleiner wrote:

What I mean is: The original MySQL DB has columns with int(10). And the
converting tool converts all these columns in SQLite to Int
I can change the conversion so that all columns would be INTEGER in SQLite.
As I understand for SQLite it is equal if the column is declared as Int or
INTEGER?



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/SQLite-Datareader-problems-with-Int-tp75670p75674.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Stephen Chrzanowski
Technically, SQLite thinks STRING = INTEGER as far as field definitions are
concerned, but either int or integer will do the job.


On Thu, May 15, 2014 at 2:22 AM, Werner Kleiner <sqliteh...@web.de> wrote:

> What I mean is: The original MySQL DB has columns with int(10). And the
> converting tool converts all these columns in SQLite to Int
> I can change the conversion so that all columns would be INTEGER in SQLite.
> As I understand for SQLite it is equal if the column is declared as Int or
> INTEGER?
>
>
>
> --
> View this message in context:
> http://sqlite.1065341.n5.nabble.com/SQLite-Datareader-problems-with-Int-tp75670p75674.html
> Sent from the SQLite mailing list archive at Nabble.com.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Werner Kleiner
What I mean is: The original MySQL DB has columns with int(10). And the
converting tool converts all these columns in SQLite to Int 
I can change the conversion so that all columns would be INTEGER in SQLite.
As I understand for SQLite it is equal if the column is declared as Int or
INTEGER?



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/SQLite-Datareader-problems-with-Int-tp75670p75674.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite Datareader problems with Int?

2014-05-14 Thread Simon Slavin

On 14 May 2014, at 3:19pm, Kleiner Werner wrote:

> Could it be a problem or does it matter if we convert all SQLite int columns 
> to INTEGER?

SQLite does not have an 'int(10)' type.  For integers it has only INTEGER.  
There should be no problem with the conversion.

There may be a problem later with your program if your code depends on a number 
being truncated to ten digits.  SQLite would not do this.  However, it is very 
unusual for a program to depend on it.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLite Datareader problems with Int?

2014-05-14 Thread Kleiner Werner
Hello,

A program written in C# use SQLite datareader to read SQLite tables and columns.
We have some problems now with SQLite columns which are declared as "int" (not 
INTEGER)
It seems that the SQlite datareader recognice these columns as integer 32 bit.
If we change the columns to "INTEGER" all works fine.

Sorry that I can't give you more details. I am no C# programmer.

My questions are:

1. Had someone other here same problems with int columns and datareader?

2. We do a convertion from a MySQL db to SQLite with a tool. It converts all 
MySQL int(10) to SQLite int.
Could it be a problem or does it matter if we convert all SQLite int columns to 
INTEGER?
As I understand the docu, for SQLite it makes no difference.

kind regards
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users