[sqlite] SQLite Datareader problems with Int?
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
[sqlite] Corrupt database
Hello, A collegue has strange behavior with a sqlite database. The original DB is about 13 MB. After storing 40 entries in a table the disk space is double and about 26 MB. It is a program written in C# and used the SQLite datareader. Now, suddenly he cannot get any returns from an simle select. If he executes the same SELECT in the Firefox Plugin SQLite Administrator it works fine. It is a simple select of a table with some integer columns. I have no knowledge in C# and SQLite datareader. But is it possible to check the database or check why the size is so much bigger? We did a PRAGMA integrity_check which has no errors. thank you for any help best regards ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] General error: 11 malformed database schema - near "'NOCASE'":
Hello I have a strange problem. On my Windows 7 XAMPP there is a little web application. The PHP connection to SQLite DB (3.3.7) is made with PDO. On Windows all is fine. Now I copied complete project to a Web Hoster. if I want to call my start page I get the error: General error: 11 malformed database schema - near "'NOCASE'": The table has some columns which are declared as NOCASE I have no idea why the SQLite db works fine on Windows but not on the WebSpace? (because it is Linux?) thanks for any idea? best regards Werner ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Storing amount?
Hello, a PHP script stores an amount into a SQLite table column "salary" which is defined as float(10,0) I a user fill in 5 into a textfield, this value is stored as 5000.0 Why this? why not 5 ? If I do the same in MySQL, where the column is defined as decimal(10,0) it is stored correct as 5. PS: I did the convertion from mysql to sqlite with a converter tool which converts the MySQL decimal(10,0) to SQLite float(10,0) automatically. Is this the wrong datatype in SQLite for storing amounts? best regards Werner ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Problems with INT columns
Hello In our SQLite DB there are some tables with column type as "int" which contains values with 13 digits, like 189336960 It seems that the values are stored correct in SQLite table. But if our Windows Tool with the SQLite Datareader tries to select this value it returns wrong values. We tracked it down to the column being created as type INT instead of INTEGER. SQLite treats these as the same, but System.Data.SQLite treats INT as Int32 and INTEGER as Int64 using SQLiteDatareader. Changing the Columns in the affected table from INT to INTEGER the error go away. SQLiteDataReader reader = _sqlDbCommand.ExecuteReader(); int fieldCount = reader.FieldCount; while (reader.Read()) { for (int i = 0; i < fieldCount; i++) { string name = reader.GetName(i); string value = reader.GetValue(i).ToString(); string typeName = reader.GetDataTypeName(i); string typeName2 = reader.GetProviderSpecificFieldType(i).ToString(); . // INT is treated as Int32 // INTEGER is treated as Int64 . } } Does someone has any idea why is this behavior? If I understand the SQLite Docu correct there is no difference between INT or INTEGER, except if you use a column as Primary Autoincrement. I thought an Int column in SQLite is always 64bit integer, but why does the SQLiteDatareader does it recognize as integer 32? What is the difference if I declare a column as bigint or int? best regards Hans ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Use of AUTOINCREMENT
Hello I saw some discussions here about using the word "AUTOINCREMENT" for a primary key or not. Sometimes the meaning is "INTEGER PRIMARY KEY" is enough, because this will also make an auto increment id. Can someone give me a clarification if "AUTOINCREMENT" is needed or not? In the FAQ I can read this; " The new key will be unique over all keys currently in the table, but it might overlap with keys that have been previously deleted from the table." Does this mean, if there are 10 rows with id 1 -10 and I delete row with id 5, then the next insert will be ID = 5? Or is next ID = 11? I understand that if I need absolutely unique IDs over the lifetime I need to use AUTOINCREMENT. That's correct? And with AUTOINCREMENT the last IDs will be stored in a table "sqlite_sequence"?[https://3c.web.de/mail/client/dereferrer?redirectUrl=http%3A%2F%2Fsqlite.org%2Ffileformat2.html%23seqtab] Are there sow disatvantages of using AUTOINCREMENT , like SQLite is slower or something else? best regard ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users