Re: [sqlite] Integer Truncation Issue

2012-04-06 Thread Jay Howard
Eveyone has been a great help, I belive that I wil have to back to the 3dr party vendor to have them change the schema to fit teh actual data... Thanks Jay From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Joe Mistachk

Re: [sqlite] Compiling with VS 2010 (force foreign key constraints)

2012-04-06 Thread Joe Mistachkin
Matjaž Cof wrote: > > Thank's to all. > Stupid me. But still not working. Is there any documentation how to compile > SQLite.NET.2010 solution with SQLITE_DEFAULT_FOREIGN_KEYS=1. > This would require modifying the Visual Studio properties file for the correct version of Visual Studio (2010 in y

Re: [sqlite] Compiling with VS 2010 (force foreign key constraints)

2012-04-06 Thread Matjaž Cof
Thank's to all. Stupid me. But still not working. Is there any documentation how to compile SQLite.NET.2010 solution with SQLITE_DEFAULT_FOREIGN_KEYS=1. I think, that the problem is, that i am using precompiled SQLite.Interop.dll (which is compiled without SQLITE_DEFAULT_FOREIGN_KEYS=1 - i think -

Re: [sqlite] Bug when modifying user-defined function with -1 arguments

2012-04-06 Thread Jim Ursetto
At 01:32pm on 2012 April 06, Richard Hipp did write: > On Fri, Apr 6, 2012 at 1:54 PM, Jim Ursetto wrote: > > Create a function foo with 1 argument, encoding UTF8 > > Create a function foo with -1 arguments, encoding UTF8 > > Delete or modify foo with -1 arguments, encoding UTF8 > > - However, nA

Re: [sqlite] Compiling with VS 2010 (force foreign key constraints)

2012-04-06 Thread Joe Mistachkin
Matjaž Cof wrote: > > I am running the latest version. (Just starting to use SQLite and really > like it). > Like i sad, i don't want to write sql every time i connec't to database. > And i use EntityFramework, witch means that ObjectContext doesn't have any > ExecuteSql method and because of tha

Re: [sqlite] Bug when modifying user-defined function with -1 arguments

2012-04-06 Thread Richard Hipp
On Fri, Apr 6, 2012 at 1:54 PM, Jim Ursetto wrote: > I believe there is a bug when deleting or modifying an existing function > with nArg == -1, when there is also an existing function of the same name > with nArg >= 0. It occurs because when nArg == -1, the match quality is > always 6 for the f

Re: [sqlite] Integer Truncation Issue

2012-04-06 Thread Joe Mistachkin
Jay Howard wrote: > > I have gone as far as > > Modifying the table but still no dice.. > Maybe I have to drop and recreate the table? > How did you change the data type of the column without dropping and re-creating the table? As others have said, System.Data.SQLite uses the declared types

[sqlite] Bug when modifying user-defined function with -1 arguments

2012-04-06 Thread Jim Ursetto
I believe there is a bug when deleting or modifying an existing function with nArg == -1, when there is also an existing function of the same name with nArg >= 0. It occurs because when nArg == -1, the match quality is always 6 for the first function encountered regardless of arity, assuming enco

Re: [sqlite] Integer Truncation Issue

2012-04-06 Thread Jay Howard
This is my connection string .. SQLiteConnection cnn = new SQLiteConnection("Data Source=C:\\ProgramData\\2SE\\be.db"); I open up the same db from sqlliteadmin -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Pavel Ivanov

Re: [sqlite] Integer Truncation Issue

2012-04-06 Thread Pavel Ivanov
> When I browse the table it shows one record > I open the db connection in c# and it still has 31821 records in it... Which means you open connections to different databases. Try to use absolute path for database name. Pavel On Fri, Apr 6, 2012 at 11:20 AM, Jay Howard wrote: > To add to the

Re: [sqlite] Compiling with VS 2010 (force foreign key constraints)

2012-04-06 Thread Matjaž Cof
I am running the latest version. (Just starting to use SQLite and really like it). Like i sad, i don't want to write sql every time i connec't to database. And i use EntityFramework, witch means that ObjectContext doesn't have any ExecuteSql method and because of that, i try to recompile with SQLIT

Re: [sqlite] Integer Truncation Issue

2012-04-06 Thread Jay Howard
To add to the confusion, I have dropped and recreated the table utilizing REAL instead of INT. I added one record to the table I did a cleanup ( vacuum?) Of the db and got rid of all old data. When I browse the table it shows one record I open the db connection in c# and it still has 31821 records

Re: [sqlite] Importing date string 'YYYYMMDD'

2012-04-06 Thread John
On 02/04/2012 5:20 AM, Simon Slavin wrote: On 1 Apr 2012, at 6:59am, John McMahon wrote: Thanks Igor (and Simon) That is pretty much the path I was thinking of taking (or possibly externally as I import the data), was just wondering if I had missed something in the date functions. You're

Re: [sqlite] Integer Truncation Issue

2012-04-06 Thread Jay Howard
I have gone as far as Modifying the table but still no dice.. Maybe I have to drop and recreate the table? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Richardson Sent: Friday, April 06, 2012 9:38 AM To: General Dis

Re: [sqlite] Integer Truncation Issue

2012-04-06 Thread Rob Richardson
Disclaimer: I am not in any way an expert! As I understand things, in SQLite, any value can be stored in any column, regardless of type. But in C#, the System.Data.SQLite library isn't that flexible. If the table definition says the column contains integers, then all data in the table is pro

Re: [sqlite] Compiling with VS 2010 (force foreign key constraints)

2012-04-06 Thread Simon Slavin
On 6 Apr 2012, at 1:50pm, Matjaž Cof wrote: > But here is the problem. For foregein key i can insert any value even if > inserted ID not exist in reference table. See this page You must be running at least 3.6.19. And you must have PRAGMA foreign_keys =

[sqlite] Integer Truncation Issue

2012-04-06 Thread Jay Howard
I have a strange issue, I have a table from a 3rd part piece fo software that I am trying to debug... The schema is below CREATE TABLE [energy_history] ( [addr] INT NULL, [year] INT NULL, [month] INT NULL, [day] INT NULL, [hour] INT NULL, [min] INT NULL, [ch1_amps_avg] INT NU

Re: [sqlite] Compiling with VS 2010 (force foreign key constraints)

2012-04-06 Thread Matjaž Cof
I figure it out, that ObjectListView "eat" error. I was missing SQLite.Interop.dll. I found it in prebuild ( http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki). But here is the problem. For foregein key i can insert any value even if inserted ID not exist in reference table. I

Re: [sqlite] sqlite3_transaction trans(db); can't work in c, I don't know why?

2012-04-06 Thread Andrew Barnes
>>>sqlite_transaction trans(db); >>>sqlite3_prepare(db,"insert into image values('.rar',?);",-1,&stat,0); >>>sqlite3_bind_blob(stat,1,ffile,filesize,NULL); >>>sqlite3_step(stat); >>>free(ffile); >>>sqlite3_finalize(stat); >>>trans.commit(); and what happens? what do you thing shou

Re: [sqlite] xCreate calling itself

2012-04-06 Thread Steinar Midtskogen
I ran gdb to find out more, and here's how sqlite3_declare_vtab() exits: 102133if( !db->pVtabCtx || !(pTab = db->pVtabCtx->pTab) ){ (gdb) n 102134 sqlite3Error(db, SQLITE_MISUSE, 0); (gdb) print db->pVtabCtx $1 = (VtabCtx *) 0x0 To explain further what I'm doing: My virtual table basical

[sqlite] xCreate calling itself

2012-04-06 Thread Steinar Midtskogen
Hello, In certain cases when I try to create a virtual table, sqlite3_declare_vtab() returns SQLITE_MISUSE. Nothing appears to be wrong with the string I pass to the sqlite3_declare_vtab(). That is, if I execute the "create table" statement in that string, a regular table will be created - no er