Re: [sqlite] bind field name?

2013-05-14 Thread Igor Tandetnik

On 5/14/2013 7:47 PM, E. Timothy Uy wrote:

Hi, is it possible to bind a field name to a sqlite query?

For example,

WHERE @field1 > @param1


No. A parameter may only appear where a literal would be allowed.
--
Igor Tandetnik

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


[sqlite] bind field name?

2013-05-14 Thread E. Timothy Uy
Hi, is it possible to bind a field name to a sqlite query?

For example,

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


Re: [sqlite] Question about the changes to e_select.test

2013-05-14 Thread Richard Hipp
On Tue, May 14, 2013 at 3:39 PM, Lauren Foutz wrote:

>  test 4.10 went from:
>   "SELECT group_concat(y) FROM b2 GROUP BY x" {0,1   3   2,4}
>
> To:
>
>   "SELECT group_concat(y) FROM b2 GROUP BY x" {/#,#   3   #,#/}
>

The other change (that you didn't notice) is that the expected result is
now surrounded by /../.  The /../ means that the expected result is in fact
a regular expression in which # is shorthand for "[0-9]+".

The reason for this change is that the original test made assumptions about
the output that are not necessarily true.  The group_concat() function
promises to concatenate strings together, but it makes no promises about
the order in which they are grouped together.  If three input strings are
A, B, and C, then the output can legally by any of the following:  A,B,C
A,C,B  B,A,C  B,C,A  C,A,B  C,B,A.

In the example above, the test was originally assuming that the output
would always be 0,1, when it could in fact be 1,0.  A change to the query
optimizer caused the output to sometimes appear as 1,0, so we needed to
change the test to accommodate this legal and correct result.

-- 
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] Question about the changes to e_select.test

2013-05-14 Thread Lauren Foutz
Recently several of the expected results in the test e_select.test were 
changed to results that look very odd.  Basically the numbers that were 
returned by the query were replaced with lots of "#". For example, test 
4.10 went from:


# EVIDENCE-OF: R-14926-50129 For the purposes of grouping rows, NULL
# values are considered equal.
#
do_select_tests e_select-4.10 {
  1  "SELECT group_concat(y) FROM b2 GROUP BY x" {0,1   3   2,4}
  2  "SELECT count(*) FROM b2 GROUP BY CASE WHEN y<4 THEN NULL ELSE 0 
END" {4 1}

}

To:

# EVIDENCE-OF: R-14926-50129 For the purposes of grouping rows, NULL
# values are considered equal.
#
do_select_tests e_select-4.10 {
  1  "SELECT group_concat(y) FROM b2 GROUP BY x" {/#,#   3   #,#/}
  2  "SELECT count(*) FROM b2 GROUP BY CASE WHEN y<4 THEN NULL ELSE 0 
END" {4 1}

}

The change was in a change set meant to fix test failures after changes 
to the query optimizer, but I fail to see how changing the optimizer 
would change the results of queries in such an odd way. Was this change 
intentional, and if so, why are such odd results being printed out now?


You can view the specific change set at 
http://www.hwaci.com/cgi-bin/sqlite/fdiff?v1=69013a64b4694588=07e8d81268ba1ffc


Thanks for your time.

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


Re: [sqlite] Beginning database question

2013-05-14 Thread Bradley Giesbrecht
On May 14, 2013, at 10:12 AM, Roman Fleysher wrote:

> I am new to database and SQLite too. I found this in archive. What if I would 
> like GUI, where I would go?

You could give the Firefox plugin "SQLite Manager" a try:
https://addons.mozilla.org/En-us/firefox/addon/sqlite-manager/


Regards,
Bradley Giesbrecht (pixilla)

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


Re: [sqlite] Compiling libtclsqlite3.so on Cygwin

2013-05-14 Thread Keith Christian
OK Warren, you've helped greatly, thanks again for the assistance, will
check other forums if the shared object / dll problems continue.

Keith


On Tue, May 14, 2013 at 10:53 AM, Warren Young  wrote:

> On 5/14/2013 09:14, Keith Christian wrote:
>
>>
>> couldn't load file "./tclsqlite3.o": Exec format error
>>
>
> From the Tcl manual: 
> http://tmml.sourceforge.net/**doc/tcl/load.html
>
> "...such as a .so file under Solaris or a DLL under Windows."
>
> Not *.o!
>
> My Tcl is awfully rusty, but I managed to get it to load with:
>
> load libsqlite3.7.16.2.dll "SQLite3"
>
> I have no idea what to do with it having loaded it.  (Again, the rust.)
>
> You're rapidly getting off-topic here, though.  There's a good chance that
> if you have further questions that they belong on a Cygwin or Tcl forum.
>
> __**_
> 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


[sqlite] Beginning database question

2013-05-14 Thread Roman Fleysher
I am new to database and SQLite too. I found this in archive. What if I would 
like GUI, where I would go?


Thank you,


Roman


I assume when you say "discrete" you actually mean "bracketed" as there are
lots more than 10 heights and weights.

I don't know what Excel has to do with this unless you programmed the whole
thing in Excel already?

Is speed really a concern?  This does sound like a fairly trivial
programming effort in most any language.

The database approach would be nice if you have bracketed weights as a
simple SQL query like this should work:

Create table teams(heightlow,heighthigh,weightlow,weighthigh,team);
Insert into hw values(100,110,60,62,1);  (100-110lbs 60-62", Team#1)

Select team from teams where h > = heightlow and h < heighthigh and w >=
weightlow and w < weighthigh;

Do you want a GUI around this too?

-Original Message-
From: sqlite-users-bounces at 
sqlite.org
[mailto:sqlite-users-bounces at 
sqlite.org] On 
Behalf Of Carl Gross
Sent: Tuesday, April 16, 2013 3:28 AM
To: sqlite-users at 
sqlite.org
Subject: [sqlite] Beginning database question

Hi All,

I'm an amateur programmer who has never worked with databases before.  I
*think* that getting started with SQLite may help with some of my projects,
but I'm having trouble determining exactly how.  I'm hoping someone in this
list may be able to point me in the right direction.

My simplified situation is this.  There are 10 discrete heights' and 10
discrete weights,' and each height/weight combination corresponds to one of
two 'teams.'  All of this information is hardcoded into my program.  My
program asks a user to enter his own height and weight, and the program
will output the user's corresponding team based on the hardcoded data.

My SQLite question is:  Can using SQLite instead of Microsoft Excel be
beneficial in terms of coding efficiency, processing speed, memory usage,
or any other aspect?  If so, how?

Sorry for the long, broad, vague question.  I'm not looking for someone to
tell me how to do something.  I'm looking for someone to assure me that
SQLite (rather than a simple spreadsheet) is right for me, and to hopefully
steer me towards some documentation that may be beneficial to me.

Thanks,

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


Re: [sqlite] Compiling libtclsqlite3.so on Cygwin

2013-05-14 Thread Warren Young

On 5/14/2013 09:14, Keith Christian wrote:


couldn't load file "./tclsqlite3.o": Exec format error


From the Tcl manual: http://tmml.sourceforge.net/doc/tcl/load.html

"...such as a .so file under Solaris or a DLL under Windows."

Not *.o!

My Tcl is awfully rusty, but I managed to get it to load with:

load libsqlite3.7.16.2.dll "SQLite3"

I have no idea what to do with it having loaded it.  (Again, the rust.)

You're rapidly getting off-topic here, though.  There's a good chance 
that if you have further questions that they belong on a Cygwin or Tcl 
forum.

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


Re: [sqlite] Malformed database recovery

2013-05-14 Thread Marcin
Of course, I understand that I haven't recovered everything, but as I said 
before, I don't find any big ammount of data lost ;)


Sent: Tuesday, May 14, 2013 5:59 PM
Subject: Re: [sqlite] Malformed database recovery




On 14 May 2013, at 4:54pm, "Marcin"  wrote:

Ok, I had a great idea, and propably somehow managed to repair it. I 
opened dump_all.sql in notepad, deleted two "/ ERROR: (11) database 
disk image is malformed */", changed ROLLBACK into COMMIT, and it is 
working so far.


The ROLLBACK indicates that the dump routine got to a certain point and 
reached corruption.  So what you have now is a database which probably 
contains just /some but not all/ of your original records.  If this is 
better than nothing for you, then that's fine, but don't use it for a year 
before realising that you have lost vital data.


Simon.
___
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] Malformed database recovery

2013-05-14 Thread Simon Slavin

On 14 May 2013, at 4:54pm, "Marcin"  wrote:

> Ok, I had a great idea, and propably somehow managed to repair it. I opened 
> dump_all.sql in notepad, deleted two "/ ERROR: (11) database disk image 
> is malformed */", changed ROLLBACK into COMMIT, and it is working so far.

The ROLLBACK indicates that the dump routine got to a certain point and reached 
corruption.  So what you have now is a database which probably contains just 
/some but not all/ of your original records.  If this is better than nothing 
for you, then that's fine, but don't use it for a year before realising that 
you have lost vital data.

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


Re: [sqlite] Malformed database recovery

2013-05-14 Thread Marcin
Ok, I had a great idea, and propably somehow managed to repair it. I opened 
dump_all.sql in notepad, deleted two "/ ERROR: (11) database disk image 
is malformed */", changed ROLLBACK into COMMIT, and it is working so 
far.


ignac8

Sent: Tuesday, May 14, 2013 5:48 PM
Subject: Re: [sqlite] Malformed database recovery



If you can get the errors, by say redirecting the output from the .read to
a file, the error message will likely be enlightening.  When I recover
corrupt db files, there are often some records with a conflicting primary
key.   In those cases I have to edit the input to fix the old one.
Naturally, you desire a commit rather than a rollback when your .read can
execute with no errors.

Others on the list are far better at explaining the output of the 
integrity

check than I am.

Adam


On Tue, May 14, 2013 at 11:40 AM, Marcin  wrote:


No errors, but tshockfixed.sqlite is empty, and in the end of file
dump_all.sql there is "ROLLBACK; -- due to errors".

It's was check of tshock.sqlite, old one.

ignac8

Sent: Tuesday, May 14, 2013 4:43 PM
Subject: Re: [sqlite] Malformed database recovery


 Where there any errors on


.read dump_all.sql ?

was PRAGMA integrity_check;  on the new file or the old one?


On Tue, May 14, 2013 at 10:29 AM, Marcin  wrote:

 Hi everybody.


Somehow my database got malformed, and journal file is unfortunately
nowhere to found.

Suprisingly, I'm able to open it in Sqlite Database Browser, and read
stored values. There is only minor data loss, as I can't really see 
what

got missing. I've also managed to figure which table is damaged.

I've tried doing this:

sqlite3.exe tshock.sqlite
sqlite> .mode insert
sqlite> .output dump_all.sql
sqlite> .dump
sqlite> .exit
sqlite3.exe tshockfixed.sqlite
sqlite> .read dump_all.sql
sqlite> .exit

But it still returns malformed one.

PRAGMA integrity_check; returns this:

*** in database main ***
On tree page 3 cell 17: invalid page number 9049
On tree page 3 cell 17: Child page depth differs
On tree page 3 cell 18: Child page depth differs
On tree page 8948 cell 86: invalid page number 9047
On tree page 8948 cell 86: Child page depth differs
On tree page 8948 cell 87: invalid page number 9051
On tree page 8948 cell 88: invalid page number 9055
On tree page 8948 cell 89: Child page depth differs
On tree page 8948 cell 90: invalid page number 9061
On tree page 8948 cell 90: Child page depth differs
On tree page 8948 cell 91: invalid page number 9066
On tree page 8948 cell 92: invalid page number 9069
On page 8948 at right child: invalid page number 9074
On tree page 9039 cell 69: invalid page number 9046
On tree page 9039 cell 69: Child page depth differs
On tree page 9039 cell 70: invalid page number 9048
On tree page 9039 cell 71: invalid page number 9050
On tree page 9039 cell 72: invalid page number 9052
On tree page 9039 cell 73: invalid page number 9053
On tree page 9039 cell 74: invalid page number 9054
On tree page 9039 cell 75: invalid page number 9056
On tree page 9039 cell 76: invalid page number 9057
On tree page 9039 cell 77: invalid page number 9058
On tree page 9039 cell 78: invalid page number 9059
On tree page 9039 cell 79: invalid page number 9060
On tree page 9039 cell 80: invalid page number 9062
On tree page 9039 cell 81: invalid page number 9063
On tree page 9039 cell 82: invalid page number 9064
On tree page 9039 cell 83: invalid page number 9065
On tree page 9039 cell 84: invalid page number 9067
On tree page 9039 cell 85: invalid page number 9068
On tree page 9039 cell 86: invalid page number 9070
On tree page 9039 cell 87: invalid page number 9071
On tree page 9039 cell 88: invalid page number 9072
On tree page 9039 cell 89: invalid page number 9073
On tree page 9039 cell 90: invalid page number 9075
On tree page 9039 cell 91: invalid page number 9077
On page 9039 at right child: invalid page number 9076
Error: database disk image is malformed

Does anybody got an idea, and can help me?

ignac8

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

>





--
VerifEye Technologies Inc.
905-948-0015x245
151 Whitehall Dr, Unit 2
Markham ON, L3R 9T1
Canada
__**_
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





--
VerifEye Technologies Inc.
905-948-0015x245
151 Whitehall 

Re: [sqlite] Malformed database recovery

2013-05-14 Thread Adam DeVita
If you can get the errors, by say redirecting the output from the .read to
a file, the error message will likely be enlightening.  When I recover
corrupt db files, there are often some records with a conflicting primary
key.   In those cases I have to edit the input to fix the old one.
Naturally, you desire a commit rather than a rollback when your .read can
execute with no errors.

Others on the list are far better at explaining the output of the integrity
check than I am.

Adam


On Tue, May 14, 2013 at 11:40 AM, Marcin  wrote:

> No errors, but tshockfixed.sqlite is empty, and in the end of file
> dump_all.sql there is "ROLLBACK; -- due to errors".
>
> It's was check of tshock.sqlite, old one.
>
> ignac8
>
> Sent: Tuesday, May 14, 2013 4:43 PM
> Subject: Re: [sqlite] Malformed database recovery
>
>
>  Where there any errors on
>>
>> .read dump_all.sql ?
>>
>> was PRAGMA integrity_check;  on the new file or the old one?
>>
>>
>> On Tue, May 14, 2013 at 10:29 AM, Marcin  wrote:
>>
>>  Hi everybody.
>>>
>>> Somehow my database got malformed, and journal file is unfortunately
>>> nowhere to found.
>>>
>>> Suprisingly, I'm able to open it in Sqlite Database Browser, and read
>>> stored values. There is only minor data loss, as I can't really see what
>>> got missing. I've also managed to figure which table is damaged.
>>>
>>> I've tried doing this:
>>>
>>> sqlite3.exe tshock.sqlite
>>> sqlite> .mode insert
>>> sqlite> .output dump_all.sql
>>> sqlite> .dump
>>> sqlite> .exit
>>> sqlite3.exe tshockfixed.sqlite
>>> sqlite> .read dump_all.sql
>>> sqlite> .exit
>>>
>>> But it still returns malformed one.
>>>
>>> PRAGMA integrity_check; returns this:
>>>
>>> *** in database main ***
>>> On tree page 3 cell 17: invalid page number 9049
>>> On tree page 3 cell 17: Child page depth differs
>>> On tree page 3 cell 18: Child page depth differs
>>> On tree page 8948 cell 86: invalid page number 9047
>>> On tree page 8948 cell 86: Child page depth differs
>>> On tree page 8948 cell 87: invalid page number 9051
>>> On tree page 8948 cell 88: invalid page number 9055
>>> On tree page 8948 cell 89: Child page depth differs
>>> On tree page 8948 cell 90: invalid page number 9061
>>> On tree page 8948 cell 90: Child page depth differs
>>> On tree page 8948 cell 91: invalid page number 9066
>>> On tree page 8948 cell 92: invalid page number 9069
>>> On page 8948 at right child: invalid page number 9074
>>> On tree page 9039 cell 69: invalid page number 9046
>>> On tree page 9039 cell 69: Child page depth differs
>>> On tree page 9039 cell 70: invalid page number 9048
>>> On tree page 9039 cell 71: invalid page number 9050
>>> On tree page 9039 cell 72: invalid page number 9052
>>> On tree page 9039 cell 73: invalid page number 9053
>>> On tree page 9039 cell 74: invalid page number 9054
>>> On tree page 9039 cell 75: invalid page number 9056
>>> On tree page 9039 cell 76: invalid page number 9057
>>> On tree page 9039 cell 77: invalid page number 9058
>>> On tree page 9039 cell 78: invalid page number 9059
>>> On tree page 9039 cell 79: invalid page number 9060
>>> On tree page 9039 cell 80: invalid page number 9062
>>> On tree page 9039 cell 81: invalid page number 9063
>>> On tree page 9039 cell 82: invalid page number 9064
>>> On tree page 9039 cell 83: invalid page number 9065
>>> On tree page 9039 cell 84: invalid page number 9067
>>> On tree page 9039 cell 85: invalid page number 9068
>>> On tree page 9039 cell 86: invalid page number 9070
>>> On tree page 9039 cell 87: invalid page number 9071
>>> On tree page 9039 cell 88: invalid page number 9072
>>> On tree page 9039 cell 89: invalid page number 9073
>>> On tree page 9039 cell 90: invalid page number 9075
>>> On tree page 9039 cell 91: invalid page number 9077
>>> On page 9039 at right child: invalid page number 9076
>>> Error: database disk image is malformed
>>>
>>> Does anybody got an idea, and can help me?
>>>
>>> ignac8
>>>
>>> ___
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>> 
>>> >
>>>
>>>
>>
>>
>> --
>> VerifEye Technologies Inc.
>> 905-948-0015x245
>> 151 Whitehall Dr, Unit 2
>> Markham ON, L3R 9T1
>> Canada
>> __**_
>> 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
>



-- 
VerifEye 

Re: [sqlite] Malformed database recovery

2013-05-14 Thread Marcin
No errors, but tshockfixed.sqlite is empty, and in the end of file 
dump_all.sql there is "ROLLBACK; -- due to errors".


It's was check of tshock.sqlite, old one.

ignac8

Sent: Tuesday, May 14, 2013 4:43 PM
Subject: Re: [sqlite] Malformed database recovery



Where there any errors on

.read dump_all.sql ?

was PRAGMA integrity_check;  on the new file or the old one?


On Tue, May 14, 2013 at 10:29 AM, Marcin  wrote:


Hi everybody.

Somehow my database got malformed, and journal file is unfortunately
nowhere to found.

Suprisingly, I'm able to open it in Sqlite Database Browser, and read
stored values. There is only minor data loss, as I can't really see what
got missing. I've also managed to figure which table is damaged.

I've tried doing this:

sqlite3.exe tshock.sqlite
sqlite> .mode insert
sqlite> .output dump_all.sql
sqlite> .dump
sqlite> .exit
sqlite3.exe tshockfixed.sqlite
sqlite> .read dump_all.sql
sqlite> .exit

But it still returns malformed one.

PRAGMA integrity_check; returns this:

*** in database main ***
On tree page 3 cell 17: invalid page number 9049
On tree page 3 cell 17: Child page depth differs
On tree page 3 cell 18: Child page depth differs
On tree page 8948 cell 86: invalid page number 9047
On tree page 8948 cell 86: Child page depth differs
On tree page 8948 cell 87: invalid page number 9051
On tree page 8948 cell 88: invalid page number 9055
On tree page 8948 cell 89: Child page depth differs
On tree page 8948 cell 90: invalid page number 9061
On tree page 8948 cell 90: Child page depth differs
On tree page 8948 cell 91: invalid page number 9066
On tree page 8948 cell 92: invalid page number 9069
On page 8948 at right child: invalid page number 9074
On tree page 9039 cell 69: invalid page number 9046
On tree page 9039 cell 69: Child page depth differs
On tree page 9039 cell 70: invalid page number 9048
On tree page 9039 cell 71: invalid page number 9050
On tree page 9039 cell 72: invalid page number 9052
On tree page 9039 cell 73: invalid page number 9053
On tree page 9039 cell 74: invalid page number 9054
On tree page 9039 cell 75: invalid page number 9056
On tree page 9039 cell 76: invalid page number 9057
On tree page 9039 cell 77: invalid page number 9058
On tree page 9039 cell 78: invalid page number 9059
On tree page 9039 cell 79: invalid page number 9060
On tree page 9039 cell 80: invalid page number 9062
On tree page 9039 cell 81: invalid page number 9063
On tree page 9039 cell 82: invalid page number 9064
On tree page 9039 cell 83: invalid page number 9065
On tree page 9039 cell 84: invalid page number 9067
On tree page 9039 cell 85: invalid page number 9068
On tree page 9039 cell 86: invalid page number 9070
On tree page 9039 cell 87: invalid page number 9071
On tree page 9039 cell 88: invalid page number 9072
On tree page 9039 cell 89: invalid page number 9073
On tree page 9039 cell 90: invalid page number 9075
On tree page 9039 cell 91: invalid page number 9077
On page 9039 at right child: invalid page number 9076
Error: database disk image is malformed

Does anybody got an idea, and can help me?

ignac8

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





--
VerifEye Technologies Inc.
905-948-0015x245
151 Whitehall Dr, Unit 2
Markham ON, L3R 9T1
Canada
___
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] Compiling libtclsqlite3.so on Cygwin

2013-05-14 Thread Keith Christian
Warren, thanks, that built the tclsqlite3.o correctly, and a libsqlite3
file also:

-rw-r--r--  1 kchristian Domain Users  39279 May 14 08:47 tclsqlite3.o
-rwxr-xr-x  1 kchristian Domain Users 173214 May 14 08:47
libsqlite3.7.16.2.dll



Another question, with a small test script, this error is output script:

couldn't load file "./tclsqlite3.o": Exec format error
while executing
"load ./tclsqlite3.o"
(file "./test_tclsqlite3.tcl" line 2)


=TEST SCRIPT START==
#!/usr/bin/tclsh
load ./tclsqlite3.o

sqlite3 db1 ./tcl_interface.db

db1 eval {CREATE TABLE IF NOT EXISTS t1(a int, b text)}
db1 eval {INSERT INTO t1 VALUES('1','hello')}
db1 eval {INSERT INTO t1 VALUES('2','goodbye')}
db1 eval {INSERT INTO t1 VALUES('3','howdy!')}

set x [db1 eval {SELECT * FROM t1 ORDER BY a}]

db1 eval {SELECT * FROM t1 ORDER BY a} values {
parray values
puts ""
}
=TEST SCRIPT END


Any suggestions for this one?  (Had to chmod u+x tclsqlite3.o, otherwise
got: 'couldn't load file "./tclsqlite3.o": Permission denied' error.)

Thanks again.





On Mon, May 13, 2013 at 8:10 PM, Warren Young  wrote:

> On 5/13/2013 16:36, Keith Christian wrote:
>
>> gcc -o libtclsqlite3.so -shared tea/generic/tclsqlite3.c -lpthread -ldl
>> -ltcl
>>
>
> Don't build it that way.  It appears that the TEA build system sees Cygwin
> and thinks "oh, this is Windows, so it must be VC++ or MinGW". That
> prevents it from linking to the Cygwin SQLite library.
>
> This seems to do the right thing:
>
> ... at the top-level of the source tree:
> $ cd tea
> $ ./configure --with-system-sqlite
> $ make
>
> Do a "make clean" before the last step if you have any *.o files laying
> around.  The shipped build system isn't smart enough to rebuild everything
> when you reconfigure with a very different set of compile and link options.
> __**_
> 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] Running sqlite script in Sqlite db using C++

2013-05-14 Thread Simon Slavin

On 14 May 2013, at 1:59pm, Dulini Atapattu  wrote:

> If anyway I omit these sqlite commands from script, so is there anyway of
> providing the script file to API?

If you strip out the lines which start with a dot, everything else in the 
script should be a legitimate SQL command.  You could use the API to execute 
the whole thing as one bit _exec().  But it would be more conventional to read 
the file in a line at a time, and execute each line separately.

You should write your own code to open the database file you want the results 
in, then do all the _exec() commands, checking the result returned to make sure 
there were no errors, then close the file.

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


Re: [sqlite] Malformed database recovery

2013-05-14 Thread Adam DeVita
Where there any errors on

.read dump_all.sql ?

was PRAGMA integrity_check;  on the new file or the old one?


On Tue, May 14, 2013 at 10:29 AM, Marcin  wrote:

> Hi everybody.
>
> Somehow my database got malformed, and journal file is unfortunately
> nowhere to found.
>
> Suprisingly, I'm able to open it in Sqlite Database Browser, and read
> stored values. There is only minor data loss, as I can't really see what
> got missing. I've also managed to figure which table is damaged.
>
> I've tried doing this:
>
> sqlite3.exe tshock.sqlite
> sqlite> .mode insert
> sqlite> .output dump_all.sql
> sqlite> .dump
> sqlite> .exit
> sqlite3.exe tshockfixed.sqlite
> sqlite> .read dump_all.sql
> sqlite> .exit
>
> But it still returns malformed one.
>
> PRAGMA integrity_check; returns this:
>
> *** in database main ***
> On tree page 3 cell 17: invalid page number 9049
> On tree page 3 cell 17: Child page depth differs
> On tree page 3 cell 18: Child page depth differs
> On tree page 8948 cell 86: invalid page number 9047
> On tree page 8948 cell 86: Child page depth differs
> On tree page 8948 cell 87: invalid page number 9051
> On tree page 8948 cell 88: invalid page number 9055
> On tree page 8948 cell 89: Child page depth differs
> On tree page 8948 cell 90: invalid page number 9061
> On tree page 8948 cell 90: Child page depth differs
> On tree page 8948 cell 91: invalid page number 9066
> On tree page 8948 cell 92: invalid page number 9069
> On page 8948 at right child: invalid page number 9074
> On tree page 9039 cell 69: invalid page number 9046
> On tree page 9039 cell 69: Child page depth differs
> On tree page 9039 cell 70: invalid page number 9048
> On tree page 9039 cell 71: invalid page number 9050
> On tree page 9039 cell 72: invalid page number 9052
> On tree page 9039 cell 73: invalid page number 9053
> On tree page 9039 cell 74: invalid page number 9054
> On tree page 9039 cell 75: invalid page number 9056
> On tree page 9039 cell 76: invalid page number 9057
> On tree page 9039 cell 77: invalid page number 9058
> On tree page 9039 cell 78: invalid page number 9059
> On tree page 9039 cell 79: invalid page number 9060
> On tree page 9039 cell 80: invalid page number 9062
> On tree page 9039 cell 81: invalid page number 9063
> On tree page 9039 cell 82: invalid page number 9064
> On tree page 9039 cell 83: invalid page number 9065
> On tree page 9039 cell 84: invalid page number 9067
> On tree page 9039 cell 85: invalid page number 9068
> On tree page 9039 cell 86: invalid page number 9070
> On tree page 9039 cell 87: invalid page number 9071
> On tree page 9039 cell 88: invalid page number 9072
> On tree page 9039 cell 89: invalid page number 9073
> On tree page 9039 cell 90: invalid page number 9075
> On tree page 9039 cell 91: invalid page number 9077
> On page 9039 at right child: invalid page number 9076
> Error: database disk image is malformed
>
> Does anybody got an idea, and can help me?
>
> ignac8
>
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users
>



-- 
VerifEye Technologies Inc.
905-948-0015x245
151 Whitehall Dr, Unit 2
Markham ON, L3R 9T1
Canada
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Malformed database recovery

2013-05-14 Thread Marcin

Hi everybody.

Somehow my database got malformed, and journal file is unfortunately nowhere 
to found.


Suprisingly, I'm able to open it in Sqlite Database Browser, and read stored 
values. There is only minor data loss, as I can't really see what got 
missing. I've also managed to figure which table is damaged.


I've tried doing this:

sqlite3.exe tshock.sqlite
sqlite> .mode insert
sqlite> .output dump_all.sql
sqlite> .dump
sqlite> .exit
sqlite3.exe tshockfixed.sqlite
sqlite> .read dump_all.sql
sqlite> .exit

But it still returns malformed one.

PRAGMA integrity_check; returns this:

*** in database main ***
On tree page 3 cell 17: invalid page number 9049
On tree page 3 cell 17: Child page depth differs
On tree page 3 cell 18: Child page depth differs
On tree page 8948 cell 86: invalid page number 9047
On tree page 8948 cell 86: Child page depth differs
On tree page 8948 cell 87: invalid page number 9051
On tree page 8948 cell 88: invalid page number 9055
On tree page 8948 cell 89: Child page depth differs
On tree page 8948 cell 90: invalid page number 9061
On tree page 8948 cell 90: Child page depth differs
On tree page 8948 cell 91: invalid page number 9066
On tree page 8948 cell 92: invalid page number 9069
On page 8948 at right child: invalid page number 9074
On tree page 9039 cell 69: invalid page number 9046
On tree page 9039 cell 69: Child page depth differs
On tree page 9039 cell 70: invalid page number 9048
On tree page 9039 cell 71: invalid page number 9050
On tree page 9039 cell 72: invalid page number 9052
On tree page 9039 cell 73: invalid page number 9053
On tree page 9039 cell 74: invalid page number 9054
On tree page 9039 cell 75: invalid page number 9056
On tree page 9039 cell 76: invalid page number 9057
On tree page 9039 cell 77: invalid page number 9058
On tree page 9039 cell 78: invalid page number 9059
On tree page 9039 cell 79: invalid page number 9060
On tree page 9039 cell 80: invalid page number 9062
On tree page 9039 cell 81: invalid page number 9063
On tree page 9039 cell 82: invalid page number 9064
On tree page 9039 cell 83: invalid page number 9065
On tree page 9039 cell 84: invalid page number 9067
On tree page 9039 cell 85: invalid page number 9068
On tree page 9039 cell 86: invalid page number 9070
On tree page 9039 cell 87: invalid page number 9071
On tree page 9039 cell 88: invalid page number 9072
On tree page 9039 cell 89: invalid page number 9073
On tree page 9039 cell 90: invalid page number 9075
On tree page 9039 cell 91: invalid page number 9077
On page 9039 at right child: invalid page number 9076
Error: database disk image is malformed

Does anybody got an idea, and can help me?

ignac8

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


Re: [sqlite] Running sqlite script in Sqlite db using C++

2013-05-14 Thread fnoyanisi
You may want to consider writing a bash/msdos-batch file and do your stuff from 
your OS command line

Bıt C API is quite handy, you can do most of the stuff with it.

On 14/05/2013, at 10:29 PM, Dulini Atapattu  wrote:

> If anyway I omit these sqlite commands from script, so is there anyway of
> providing the script file to API?
> 
> 
> On Tue, May 14, 2013 at 6:07 PM,  wrote:
> 
>> If you are dealing with CSV files, there is a simple API I wrote you can
>> use.
>> 
>> https://github.com/fnoyanisi/sqlite3_capi_extensions
>> 
>> I was looking for .import functionality for C API, but I ended up writing
>> my own fınctions.
>> 
>> On 14/05/2013, at 9:39 PM, Richard Hipp  wrote:
>> 
>>> On Tue, May 14, 2013 at 1:53 AM, Dulini Atapattu
>>> wrote:
>>> 
 Hi all,
 
 I have some sqlite scripts with some sqlite commands like:
 
  - .headers ON
  - .mode CSV etc.
 
 Is there anyway of running this script in SqliteDB using Sqlite
>> interface
 for C++, instead of redirecting the file to sqlite using sqlite command
 line shell?
>>> 
>>> Those commands are implemented by the sqlite3 command-line shell, not by
>>> the SQLite library.
>>> 
>>> You can copy/paste the code out of the sqlite3 command-line shell source
>>> code (www.sqlite.org/src/artifact/2109d54f67) and add that code to your
>> C++
>>> application, I suppose.
>>> 
>>> --
>>> 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-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
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Running sqlite script in Sqlite db using C++

2013-05-14 Thread Dulini Atapattu
If anyway I omit these sqlite commands from script, so is there anyway of
providing the script file to API?


On Tue, May 14, 2013 at 6:07 PM,  wrote:

> If you are dealing with CSV files, there is a simple API I wrote you can
> use.
>
> https://github.com/fnoyanisi/sqlite3_capi_extensions
>
> I was looking for .import functionality for C API, but I ended up writing
> my own fınctions.
>
> On 14/05/2013, at 9:39 PM, Richard Hipp  wrote:
>
> > On Tue, May 14, 2013 at 1:53 AM, Dulini Atapattu
> > wrote:
> >
> >> Hi all,
> >>
> >> I have some sqlite scripts with some sqlite commands like:
> >>
> >>   - .headers ON
> >>   - .mode CSV etc.
> >>
> >> Is there anyway of running this script in SqliteDB using Sqlite
> interface
> >> for C++, instead of redirecting the file to sqlite using sqlite command
> >> line shell?
> >
> > Those commands are implemented by the sqlite3 command-line shell, not by
> > the SQLite library.
> >
> > You can copy/paste the code out of the sqlite3 command-line shell source
> > code (www.sqlite.org/src/artifact/2109d54f67) and add that code to your
> C++
> > application, I suppose.
> >
> > --
> > 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-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] Matchinfo FTS4 token position

2013-05-14 Thread Stadin, Benjamin
Ok, thanks. I understand offset will come with a performance slowdown, but
should be ok for my purpose.

However, how can I get the offset(s) as part of the rank function
implementation? The FTS offsets function is private:

SQLITE_PRIVATE void sqlite3Fts3Offsets(sqlite3_context*, Fts3Cursor*);



Regards
Ben

Am 14.05.13 14:06 schrieb "Richard Hipp" unter :

>On Mon, May 13, 2013 at 12:25 PM, Stadin, Benjamin <
>benjamin.sta...@heidelberg-mobil.com> wrote:
>
>> Hi all,
>>
>> I need to implement a ranking that considers the search result's token
>> distance (so either the actual character offset, or token offset from
>>the
>> beginning of the text). Is it possible to get/query this distance from
>>the
>> FTS4 index (either directly or via ft4saux), or would I have to parse
>>the
>> content of each text column?
>>
>
>The offsets() function provides this information.
>http://www.sqlite.org/fts3.html#offsets
>
>-- 
>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-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Running sqlite script in Sqlite db using C++

2013-05-14 Thread fnoyanisi
If you are dealing with CSV files, there is a simple API I wrote you can use.

https://github.com/fnoyanisi/sqlite3_capi_extensions

I was looking for .import functionality for C API, but I ended up writing my 
own fınctions.

On 14/05/2013, at 9:39 PM, Richard Hipp  wrote:

> On Tue, May 14, 2013 at 1:53 AM, Dulini Atapattu
> wrote:
> 
>> Hi all,
>> 
>> I have some sqlite scripts with some sqlite commands like:
>> 
>>   - .headers ON
>>   - .mode CSV etc.
>> 
>> Is there anyway of running this script in SqliteDB using Sqlite interface
>> for C++, instead of redirecting the file to sqlite using sqlite command
>> line shell?
> 
> Those commands are implemented by the sqlite3 command-line shell, not by
> the SQLite library.
> 
> You can copy/paste the code out of the sqlite3 command-line shell source
> code (www.sqlite.org/src/artifact/2109d54f67) and add that code to your C++
> application, I suppose.
> 
> -- 
> 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-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Running sqlite script in Sqlite db using C++

2013-05-14 Thread Richard Hipp
On Tue, May 14, 2013 at 1:53 AM, Dulini Atapattu
wrote:

> Hi all,
>
> I have some sqlite scripts with some sqlite commands like:
>
>- .headers ON
>- .mode CSV etc.
>
> Is there anyway of running this script in SqliteDB using Sqlite interface
> for C++, instead of redirecting the file to sqlite using sqlite command
> line shell?
>

Those commands are implemented by the sqlite3 command-line shell, not by
the SQLite library.

You can copy/paste the code out of the sqlite3 command-line shell source
code (www.sqlite.org/src/artifact/2109d54f67) and add that code to your C++
application, I suppose.

-- 
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] Matchinfo FTS4 token position

2013-05-14 Thread Dan Kennedy

On 05/13/2013 11:25 PM, Stadin, Benjamin wrote:

Hi all,

I need to implement a ranking that considers the search result's token distance 
(so either the actual character offset, or token offset from the beginning of 
the text). Is it possible to get/query this distance from the FTS4 index 
(either directly or via ft4saux), or would I have to parse the content of each 
text column?


Maybe the offsets() function:

  http://www.sqlite.org/fts3.html#section_4_1

Dan.

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


Re: [sqlite] Matchinfo FTS4 token position

2013-05-14 Thread Richard Hipp
On Mon, May 13, 2013 at 12:25 PM, Stadin, Benjamin <
benjamin.sta...@heidelberg-mobil.com> wrote:

> Hi all,
>
> I need to implement a ranking that considers the search result's token
> distance (so either the actual character offset, or token offset from the
> beginning of the text). Is it possible to get/query this distance from the
> FTS4 index (either directly or via ft4saux), or would I have to parse the
> content of each text column?
>

The offsets() function provides this information.
http://www.sqlite.org/fts3.html#offsets

-- 
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] Running sqlite script in Sqlite db using C++

2013-05-14 Thread Dulini Atapattu
Hi all,

I have some sqlite scripts with some sqlite commands like:

   - .headers ON
   - .mode CSV etc.

Is there anyway of running this script in SqliteDB using Sqlite interface
for C++, instead of redirecting the file to sqlite using sqlite command
line shell?

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


[sqlite] Matchinfo FTS4 token position

2013-05-14 Thread Stadin, Benjamin
Hi all,

I need to implement a ranking that considers the search result's token distance 
(so either the actual character offset, or token offset from the beginning of 
the text). Is it possible to get/query this distance from the FTS4 index 
(either directly or via ft4saux), or would I have to parse the content of each 
text column?

Regards
Ben

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


[sqlite] another typo in planner.html

2013-05-14 Thread Amit Chaudhuri
Seection 2.0 line 4

SQLite processes this by gather all the output of query and then running ...

SQLite processes this by gathering all the output of query and then running
...

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


[sqlite] Trivial typo in queryplanner.html docs

2013-05-14 Thread Amit Chaudhuri
Hi all,

reading through queryplanner.html today I notice a trivial typo in section
1.6, line 5:

If there were a third column, it would be used to break ties for the first
to columns.
If there were a third column, it would be used to break ties for the first
tWo columns.

^^^

It doesn't spoil the read :)

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