[sqlite] make sqlite3_analyzer No rule to make target `sqlite3_analyzer'. Stop.

2012-03-29 Thread vaiStardom

Hi!

I can't seem to use the sqlite3_analyzer on my MacBook Pro 2010 i7.

Following the instructions in the book 'The Definitive Guide To Sqlite', to
analyze the test.db all I have to do is issue the command 'sqlite3_analyzer
test.db'. This command unfortunately gives me the response '-bash:
sqlite3_analyzer: command not found'.

The EXE sqlite3_analyzer is in the same directory as test.db, it was
downloaded from sqlite.org:   'Precompiled Binaries For Mac OS X (x86)
sqlite-analyzer-osx-x86-3071100.zip'.

I downloaded the source code and untared it with 'tar -xzvf
sqlite-autoconf-3071100.tar'.

I moved to the new directory and issued the command 'make sqlite3_analyzer',
which gives me the output 'make: *** No rule to make target
`sqlite3_analyzer'.  Stop.'.

Why can't I analyze my test.db?

Any tips, help or information would be greatly appreciated.

Thanks,

-- 
View this message in context: 
http://old.nabble.com/make-sqlite3_analyzer-No-rule-to-make-target-%60sqlite3_analyzer%27.--Stop.-tp33544901p33544901.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] how to merge this three command in c++

2012-03-29 Thread YAN HONG YE
This follow 3 commands,I wanna merge to c++,but don't know how to do:

sqlite3 my.db " select '' " > my.html
sqlite3 -html -header my.db " select * from BOD " >> my.html
sqlite3 my.db " select '' " >> my.html

is this follow right?
char bbb[300];
strcpy(bbb,"BEGIN\n " select '' " > my.html\n  \
-html -header " select * from BOD " >> my.html\n  \
" select '' " >> my.html\n  \
COMMIT;

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


Re: [sqlite] Primary Key uniqueness

2012-03-29 Thread Patrik Nilsson


On 03/29/2012 06:27 PM, Joe Bennett wrote:
> Hi,
> 
> I have three sqlite3 datbases that currently have no primary key (actually
> done with two and stuck on the third). I am converting them to 'new' tables
> with a primary key like so:
> 
> create table if not exists new_table
>  (Column_1,Column_2,Column_3..,Column_47, primary key(Column_1,
> Column_27, Column_47))
> 
> Now, when I insert the data from old_table into new_table, I get the error
> message 'columns Column_1,Column_27,Column_47 are not unique' using this
> syntax:
> 
> insert into new_table (Column_1,Column_2,Column_3..,Column_47) select *
> from old_table

You can use:
insert or ignore into new_table...
insert or replace into new_table...

and later find a match with "select" which data didn't get into the new
table, if they are important.

/Patrik

> 
> That's OK, shame on me for not checking that prior to the insert... Now, I
> am using this syntax to find the dupes and remove them:
> 
> select rowid, Column_1,Column_27,Column_47,count(*)
> from old_table
> group by Column_1,Column_27,Column_47
> having count(*) > 1
> 
> 
> No rows meet this criteria... So, I'm looking for a better way to find the
> non unique data in the old_table so I can clear this error and insert it
> into the new table... Any ideas?
> 
> 
> 
> 
> -Joe
> ___
> 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] Positioned Read/Write for Windows

2012-03-29 Thread GB

Hi,

recently I noticed the use of positioned Read/Write in the unix vfs. In 
Windows this can be achieved by providing an offset in an OVERLAPPED 
structure. I tried it and found a small but notable increase in 
throughput, especially during reads when most of the db is in the system 
cache. Would it be possible to have this change in the trunk?


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


Re: [sqlite] Primary Key uniqueness

2012-03-29 Thread John Gillespie
Try omitting 'rowid' - you are not grouping by it and if you did it is
unique so no dups.

select  Column_1,Column_27,Column_47 , count(*) from old_table
   group by Column_1,Column_27,Column_47
  having count(*) > 1

JG

On 29 March 2012 17:27, Joe Bennett  wrote:

> Hi,
>
> I have three sqlite3 datbases that currently have no primary key (actually
> done with two and stuck on the third). I am converting them to 'new' tables
> with a primary key like so:
>
> create table if not exists new_table
>  (Column_1,Column_2,Column_3..,Column_47, primary key(Column_1,
> Column_27, Column_47))
>
> Now, when I insert the data from old_table into new_table, I get the error
> message 'columns Column_1,Column_27,Column_47 are not unique' using this
> syntax:
>
> insert into new_table (Column_1,Column_2,Column_3..,Column_47) select *
> from old_table
>
> That's OK, shame on me for not checking that prior to the insert... Now, I
> am using this syntax to find the dupes and remove them:
>
> select rowid, Column_1,Column_27,Column_47,count(*)
> from old_table
> group by Column_1,Column_27,Column_47
> having count(*) > 1
>
>
> No rows meet this criteria... So, I'm looking for a better way to find the
> non unique data in the old_table so I can clear this error and insert it
> into the new table... Any ideas?
>
>
>
>
> -Joe
> ___
> 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] Primary Key uniqueness

2012-03-29 Thread Simon Slavin

On 29 Mar 2012, at 5:27pm, Joe Bennett  wrote:

> No rows meet this criteria... So, I'm looking for a better way to find the
> non unique data in the old_table so I can clear this error and insert it
> into the new table... Any ideas?

Instead of using the plain INSERT ... command you can use the variants

INSERT OR IGNORE ...

INSERT OR REPLACE ...

Which one you use depends on the order you're getting your old data in, and 
which record you actually want.

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


[sqlite] Primary Key uniqueness

2012-03-29 Thread Joe Bennett
Hi,

I have three sqlite3 datbases that currently have no primary key (actually
done with two and stuck on the third). I am converting them to 'new' tables
with a primary key like so:

create table if not exists new_table
 (Column_1,Column_2,Column_3..,Column_47, primary key(Column_1,
Column_27, Column_47))

Now, when I insert the data from old_table into new_table, I get the error
message 'columns Column_1,Column_27,Column_47 are not unique' using this
syntax:

insert into new_table (Column_1,Column_2,Column_3..,Column_47) select *
from old_table

That's OK, shame on me for not checking that prior to the insert... Now, I
am using this syntax to find the dupes and remove them:

select rowid, Column_1,Column_27,Column_47,count(*)
from old_table
group by Column_1,Column_27,Column_47
having count(*) > 1


No rows meet this criteria... So, I'm looking for a better way to find the
non unique data in the old_table so I can clear this error and insert it
into the new table... Any ideas?




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


Re: [sqlite] xBestIndex/xFilter Bug(?) when using LIKE "F%"

2012-03-29 Thread Dan Kennedy

On 03/23/2012 03:59 PM, Kurt Keller wrote:

I have a virtual table implementation, that implements the
xBestIndex/xFilter funktions and I found the following problem:

This query

   SELECT * FROM vf WHERE field LIKE "F%";

will result in a call to xBestIndex with the following constraint

   field>= ... AND field<  ...

when SQLITE calls xFilter, the right hand values are delivered
correctly with

   field>= "F" AND field<  "g"  /* !! */


Thanks for reporting this.

This commit disables the LIKE optimization on virtual tables:

  http://www.sqlite.org/src/info/0bacb879e1

A workaround for earlier versions would be to define 
SQLITE_OMIT_LIKE_OPTIMIZATION when compiling.


Dan.

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


Re: [sqlite] how to add time in a new column

2012-03-29 Thread Simon Davies
On 29 March 2012 12:36, Black, Michael (IS)  wrote:
> You'll need to export the table and data.  Change the SQL to what you want. 
> Then import again.
>
> Does the shell have ability to name the columns on the insert  statements 
> from the .dump to make this easier?  I don' t see anythinig offhand that 
> seems to do that.

Or use ALTER TABLE RENAME TO... and INSERT INTO...

viz

create table t( id integer, data text );
insert into t values( 1, '1' );

alter table t rename to old_t;

create table t( id integer, data text, "time" text default current_time );

insert into t( id, data ) select id, data from old_t;

>
> Michael D. Black
>
> Senior Scientist
>
> Advanced Analytics Directorate
>
> Advanced GEOINT Solutions Operating Unit
>
> Northrop Grumman Information Systems
>

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


Re: [sqlite] In-memory and temporary database

2012-03-29 Thread Eduardo Morras

At 11:32 28/03/2012, you wrote:

Hello,
   I'm doing some test with SQlite 3.7.11 in Windows Embedded industrial PC.
I need to store data in a table very quickly. Let's say new data each 10 msec.
I tryed with DB on disk but obviously was not possible to reach the correct
performance.
So I tryed with in-memory DB and in this case the performance results are
good.
The problem is that I can't share the in-memory database with other
applications.
I red a lot of article and documentation but I have not solved the problem.
Maybe with temporary DB I can have the same performance and also I can share
DB?
Have you some suggestion?


DOn't know for windows embedded. I used Linux in embedded devices 
some years ago. I used a ramdisk and from time to time create/open a 
new db/table, swap insertions to new one and close the old one. Then 
a simple move from the ramdisk to server. The last thing i did was to 
drop sqlite from the device, write an app that export data in csv 
format and send it to server directly, this worked because moved the 
decission/analisys of data from th device to the server.



Simone Pietro Lossani
Mezzomerico
Italy
___
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] how to add time in a new column

2012-03-29 Thread Black, Michael (IS)
You'll need to export the table and data.  Change the SQL to what you want. 
Then import again.



Does the shell have ability to name the columns on the insert  statements from 
the .dump to make this easier?  I don' t see anythinig offhand that seems to do 
that.





Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of YAN HONG YE [yanhong...@mpsa.com]
Sent: Thursday, March 29, 2012 12:43 AM
To: sqlite-users@sqlite.org
Subject: EXT :[sqlite] how to add time in a new column

sqlite> alter table dzh add mtime NOT NULL DEFAULT CURRENT_TIME;
Error: Cannot add a column with non-constant default
___
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] how to built xml file from sqlite database?

2012-03-29 Thread Simon Slavin

On 29 Mar 2012, at 5:17am, YAN HONG YE  wrote:

> how to built xml file from sqlite database?

No function built into SQLite to do this.

You can write your own software to read the data and make up the XML format 
from it.

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


Re: [sqlite] how to add time in a new column

2012-03-29 Thread Kevin Benson
On Thu, Mar 29, 2012 at 1:43 AM, YAN HONG YE  wrote:

> sqlite> alter table dzh add mtime NOT NULL DEFAULT CURRENT_TIME;
> Error: Cannot add a column with non-constant default
> ___
>
 http://www.sqlite.org/lang_altertable.html

 The column may not have a default value of CURRENT_TIME, CURRENT_DATE,
CURRENT_TIMESTAMP, or an expression in parentheses.
--
   --
  --
 --ô¿ô--
K e V i N
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users