[sqlite] Error code inconsistency

2012-09-03 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

The functions sqlite3_status and sqlite3_db_status do substantially the
same thing (in different scopes) and have exactly the same signature and
semantics.

However the error code they return is gratuitously different when provided
with a (currently unknown) code.  In particular sqlite3_status returns
SQLITE_MISUSE while sqlite3_db_status returns SQLITE_ERROR.

It would be appropriate to make them return the same error code and for it
to be SQLITE_NOTFOUND (just like file control uses).

The doc doesn't currently specify which codes would be returned, but the
current behaviour is very ambiguous.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAlBFQyEACgkQmOOfHg372QTddwCdFiZCPjTvq6wZCRcX7f6A3Hri
1x0An2FmAFatiJ+m7dEGa1+8mdzZlrTw
=P9kg
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite error: file is encrypted or is not a database

2012-09-03 Thread Richard Hipp
On Mon, Sep 3, 2012 at 5:43 PM, Tal Tabakman  wrote:

> Hi,
> my SQLite based app is writing an database(single thread, no concurrency,
> on top of NFS , network is involved)
> when opening the database for read we get the following error "file is
> encrypted or is not a database" when executing a simple pragma:
> "PRAGMA cache_size=1;"
> I would like to note that I am using CEROD as a compression library but i
> open the DB appropriatly with the needed "cerod::" prefix...
>
> what could be the reasons for such a strange (and gating) error?
>

The header of the database file has become corrupted.


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



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


[sqlite] sqlite error: file is encrypted or is not a database

2012-09-03 Thread Tal Tabakman
Hi,
my SQLite based app is writing an database(single thread, no concurrency,
on top of NFS , network is involved)
when opening the database for read we get the following error "file is
encrypted or is not a database" when executing a simple pragma:
"PRAGMA cache_size=1;"
I would like to note that I am using CEROD as a compression library but i
open the DB appropriatly with the needed "cerod::" prefix...

what could be the reasons for such a strange (and gating) error?

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


Re: [sqlite] How do you load a ".csv" and skip the first line?

2012-09-03 Thread danap
> Is there some way to load a ".csv" file into a SQLite database table
> when the first row (record) of the file contains headers?
>
> This does not work?
> --
> .separator ,
> .import test.csv ld_assay
>
> Here's my database / table:
> CREATE TABLE [ld_assay] (
>[id] INTEGER PRIMARY KEY,
>[barcode_id] NCHAR(9),
>[light] BOOLEAN,
>[bpm] REAL);
>
> Here's my "test.csv":
> id,barcode_id,light,bpm
> 1,02455,1,180.2
> 2,02455,1,168.3
> 3,02455,1,189.4

I'm pretty sure MyJSQLView will do this for you. Been a while
since I tested it it, but it should use the first line to
compose a SQL insert statement that only adds the columns
specified. Left out columns should take default values.

Since MyJSQLView is a Java based GUI the Zentus's SQLite
JDBC must be used as the commnuncation interface to the
SQLite database file. Add it to your java/lib/ext directory
to have it loaded automatically.

danap.

MyJSQLView
http://myjsqlview.org
SQLite JDBC
http://www.xerial.org/trac/Xerial
/wiki/SQLiteJDBC#WhatisdifferentfromZentussSQLiteJDBC

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


Re: [sqlite] how to re_update the id item

2012-09-03 Thread Simon Slavin

On 3 Sep 2012, at 7:53am, YAN HONG YE  wrote:

> my database have a column named id auto_increament inter primary key,  when I 
> delete any rows , the id item may be indiscriminate , how to update it and 
> reorder the 
> column from 1 to max(id) order by id asc?

Can you think through why you're trying to do this ?  Is there really any point 
in keeping such a number that might change ?  Is it necessary that there be no 
missing numbers in your sequence ?  What would you use this number for ?

If you have a table related to this table, then every time you change 'id' in 
this table, you must change the related column in your other table.

If you just need to know how many rows you have, you can use

SELECT count(id) FROM myTable

If you need the rows numbered, you can just number them in your software when 
you produce the list.

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


Re: [sqlite] Need to Increase sql parameter limit more than 999

2012-09-03 Thread Richard Hipp
On Mon, Sep 3, 2012 at 8:54 AM, Bhardwaj Amit Kumar <
kumaram...@johndeere.com> wrote:

> Hi,
>
> We are working on .NET application which deals with huge amount of data.
> We are using SQLite as database for this application. We are getting "too
> many sql parameters" exceptions frequently.
> We need to perform various types of queries on database which generates
> more than 999 parameters that exceeds SQLite parameter limit.
>
> We would appreciate if you would help us customizing the SQLite database
> parameter limit.
>

You will need to
recompileSystem.Data.SQLite
and set the compile-time option
SQLITE_MAX_VARIABLE_NUMBER to some value greater than 999.


>
> Kindly provide the steps to get this done.
>
> Thanks,
> Amit Bhardwaj
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


[sqlite] Need to Increase sql parameter limit more than 999

2012-09-03 Thread Bhardwaj Amit Kumar
Hi,

We are working on .NET application which deals with huge amount of data. We are 
using SQLite as database for this application. We are getting "too many sql 
parameters" exceptions frequently.
We need to perform various types of queries on database which generates more 
than 999 parameters that exceeds SQLite parameter limit.

We would appreciate if you would help us customizing the SQLite database 
parameter limit.

Kindly provide the steps to get this done.

Thanks,
Amit Bhardwaj

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


Re: [sqlite] how to re_update the id item

2012-09-03 Thread Igor Tandetnik
YAN HONG YE  wrote:
> my database have a column named id auto_increament inter primary key,  when I 
> delete any rows , the id item may be indiscriminate
> , how to update it and reorder the column from 1 to max(id) order by id asc?

It's not quite clear what you are trying to achieve. Perhaps something like 
this:

create temp table OldIds(id integer primary key);
insert into OldIds select id from MyTable;
update MyTable set id=1+(select count(*) from OldIds where OldIds.id < 
MyTable.id);
drop table OldIds;

-- 
Igor Tandetnik

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


Re: [sqlite] More bugs

2012-09-03 Thread Joe Mistachkin

Jan Slodicka wrote:
> 
> a) File operations on Windows platforms have a number of other problems.
For
> example SQLite fails to report if given folder is write-able on WinRT.
(This
> is a handy test for below mentioned directories.)
> 

This issue was recently fixed on trunk.  See:

http://www.sqlite.org/src/info/527340abff

>
> b) Global variables sqlite3_data/temp_directory do not work as advertized.
In
> fact, using them results in access violation. The workaround is simple:
Publish
> them with _declspec(dllexport) attribute. (Def file won't help.)
>

If you are needing to set these directories from another binary, could you
try
using the new sqlite3_win32_set_directory() API?

--
Joe Mistachkin

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


[sqlite] More bugs

2012-09-03 Thread Jan Slodicka
Didn't get any reaction to my previous report, hence just briefly:

a) File operations on Windows platforms have a number of other problems. For 
example SQLite fails to report if given folder is write-able on WinRT. (This is 
a handy test for below mentioned directories.)

b) Global variables sqlite3_data/temp_directory do not work as advertized. In 
fact, using them results in access violation. The workaround is simple: Publish 
them with _declspec(dllexport) attribute. (Def file won't help.)

Have a good day.

With best regards,
   Jan Slodicka
   Resco


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