[sqlite] Program crashes when delete a row in SQLite db table

2008-11-11 Thread Nithin John via YouSendIt
Priority Delivery
   
Corrupted db attached, the qyery crashes is:
delete from objects where dbname='information_schama'



   
Download File at: 
https://rcpt.yousendit.com/624254893/4d5c40a04a2eb6cdf2468bd999485ef2


Sent by: [EMAIL PROTECTED]
File to pick up: crash_db.db 
File will remain active for: 7 days 




YouSendIt Inc. : http://www.yousendit.com
Terms of Service: http://www.yousendit.com/cms/termsofservice
Privacy Policy : http://www.yousendit.com/cms/privacypolicy
DMCA Policy:  http://www.yousendit.com/cms/dmca
Opt Out: http://www.yousendit.com/blocking.php?action=optout&[EMAIL 
PROTECTED]&key=a9723f4a018026a10b720ecff9f62afad8bba475
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] DISTINCT clause bug in 3.6.4?

2008-11-11 Thread Dan

The affinities are not being applied correctly when GROUP BY is in play:

   sqlite> CREATE TABLE t1(a TEXT);
   sqlite> INSERT INTO t1 VALUES(123);
   sqlite> SELECT a=123, a='123' FROM t1;
   1|1
   sqlite> SELECT a=123, a='123' FROM t1 GROUP BY a;
   0|1

Dan.


On Nov 12, 2008, at 9:19 AM, Daniel Zingaro wrote:

> Hi,
>
> In case it helps, I've narrowed this down somewhat; it also happens  
> with
> this far simpler query:
>
> sqlite> select b.val, case when b.val = 1 then 'xyz' else b.val end as
> col1 from
> b;
> val|col1
> 1|xyz
> 2|2
> sqlite> select distinct b.val, case when b.val = 1 then 'xyz' else  
> b.val
> end as
> col1 from b;
> val|col1
> 1|1
> 2|2
>
> Thanks,
> Dan
>
> Slater, Chad wrote:
>> Hello,
>>
>> I'm working on upgrading from sqlite 3.5.7 to 3.6.4 and while running
>> some regression unit tests in my own app I noticed a couple failures.
>> Upon further investigation it looks like either a bug has been
>> introduced into sqlite between 3.5.8 and 3.6.4 or my query is wrong.
>>
>> Here's some sql to reproduce the issue:
>>
>> BEGIN;
>> CREATE TABLE A (id INTEGER PRIMARY KEY AUTOINCREMENT, val TEXT);
>> INSERT INTO A VALUES(1,'123');
>> INSERT INTO A VALUES(2,'456');
>>
>>
>> CREATE TABLE B (id INTEGER PRIMARY KEY AUTOINCREMENT, val TEXT);
>> INSERT INTO B VALUES(1,1);
>> INSERT INTO B VALUES(2,2);
>>
>> CREATE TABLE A_B (B_id INTEGER NOT NULL, A_id INTEGER);
>> INSERT INTO A_B VALUES(1,1);
>> INSERT INTO A_B VALUES(2,2);
>> COMMIT;
>>
>> The query that I'm executing:
>>
>> SELECT DISTINCT
>>   CASE
>>  WHEN B.val = 1 THEN 'XYZ'
>>  ELSE A.val
>>   END AS Col1
>> FROM B
>> LEFT OUTER JOIN A_B ON B.id = A_B.B_id
>> LEFT OUTER JOIN A ON A.id = A_B.A_id
>> ORDER BY Col1 ASC;
>>
>> I'm expecting the query to return 456 followed by XYZ. But instead it
>> returns 123 followed by 456. If I remove the DISTINCT clause it  
>> returns
>> what I'm expecting but that doesn't seem like it should matter. I
>> searched for bugs using the timeline in the wiki but didn't see  
>> anything
>> related to DISTINCT. I'm not sure where else to look...
>>
>> Is this a bug in sqlite or my query?
>>
>>
>>
>> Thanks in advance,
>>
>>
>> Chad
>> ___
>> 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] DISTINCT clause bug in 3.6.4?

2008-11-11 Thread Daniel Zingaro
Hi,

In case it helps, I've narrowed this down somewhat; it also happens with 
this far simpler query:

sqlite> select b.val, case when b.val = 1 then 'xyz' else b.val end as 
col1 from
b;
val|col1
1|xyz
2|2
sqlite> select distinct b.val, case when b.val = 1 then 'xyz' else b.val 
end as
col1 from b;
val|col1
1|1
2|2

Thanks,
Dan

Slater, Chad wrote:
> Hello,
>
> I'm working on upgrading from sqlite 3.5.7 to 3.6.4 and while running
> some regression unit tests in my own app I noticed a couple failures.
> Upon further investigation it looks like either a bug has been
> introduced into sqlite between 3.5.8 and 3.6.4 or my query is wrong. 
>
> Here's some sql to reproduce the issue:
>
> BEGIN;
> CREATE TABLE A (id INTEGER PRIMARY KEY AUTOINCREMENT, val TEXT);
> INSERT INTO A VALUES(1,'123');
> INSERT INTO A VALUES(2,'456');
>
>
> CREATE TABLE B (id INTEGER PRIMARY KEY AUTOINCREMENT, val TEXT);
> INSERT INTO B VALUES(1,1);
> INSERT INTO B VALUES(2,2);
>
> CREATE TABLE A_B (B_id INTEGER NOT NULL, A_id INTEGER);
> INSERT INTO A_B VALUES(1,1);
> INSERT INTO A_B VALUES(2,2);
> COMMIT;
>
> The query that I'm executing:
>
> SELECT DISTINCT
>CASE 
>   WHEN B.val = 1 THEN 'XYZ' 
>   ELSE A.val 
>END AS Col1
> FROM B  
> LEFT OUTER JOIN A_B ON B.id = A_B.B_id  
> LEFT OUTER JOIN A ON A.id = A_B.A_id
> ORDER BY Col1 ASC;
>
> I'm expecting the query to return 456 followed by XYZ. But instead it
> returns 123 followed by 456. If I remove the DISTINCT clause it returns
> what I'm expecting but that doesn't seem like it should matter. I
> searched for bugs using the timeline in the wiki but didn't see anything
> related to DISTINCT. I'm not sure where else to look...
>
> Is this a bug in sqlite or my query?
>
>
>
> Thanks in advance,
>
>
> Chad
> ___
> 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] DISTINCT clause bug in 3.6.4?

2008-11-11 Thread Slater, Chad
Hello,

I'm working on upgrading from sqlite 3.5.7 to 3.6.4 and while running
some regression unit tests in my own app I noticed a couple failures.
Upon further investigation it looks like either a bug has been
introduced into sqlite between 3.5.8 and 3.6.4 or my query is wrong. 

Here's some sql to reproduce the issue:

BEGIN;
CREATE TABLE A (id INTEGER PRIMARY KEY AUTOINCREMENT, val TEXT);
INSERT INTO A VALUES(1,'123');
INSERT INTO A VALUES(2,'456');


CREATE TABLE B (id INTEGER PRIMARY KEY AUTOINCREMENT, val TEXT);
INSERT INTO B VALUES(1,1);
INSERT INTO B VALUES(2,2);

CREATE TABLE A_B (B_id INTEGER NOT NULL, A_id INTEGER);
INSERT INTO A_B VALUES(1,1);
INSERT INTO A_B VALUES(2,2);
COMMIT;

The query that I'm executing:

SELECT DISTINCT
   CASE 
  WHEN B.val = 1 THEN 'XYZ' 
  ELSE A.val 
   END AS Col1
FROM B  
LEFT OUTER JOIN A_B ON B.id = A_B.B_id  
LEFT OUTER JOIN A ON A.id = A_B.A_id
ORDER BY Col1 ASC;

I'm expecting the query to return 456 followed by XYZ. But instead it
returns 123 followed by 456. If I remove the DISTINCT clause it returns
what I'm expecting but that doesn't seem like it should matter. I
searched for bugs using the timeline in the wiki but didn't see anything
related to DISTINCT. I'm not sure where else to look...

Is this a bug in sqlite or my query?



Thanks in advance,


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


Re: [sqlite] Counting rows in one table, and comparing COUNT with column in other table?

2008-11-11 Thread Gilles Ganault
On Tue, 11 Nov 2008 07:30:21 -0500, "Igor Tandetnik"
<[EMAIL PROTECTED]> wrote:
>Add "GROUP BY code.id"

Way to do. Thank you.

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


[sqlite] Please test check-in [5338] on HPUX, AIX, QNX, BSD, etc...

2008-11-11 Thread D. Richard Hipp
The UNIX driver for SQLite has for years contained a run-time test for  
locking behavior in multi-threaded programs.  This run-time test was  
necessary to work around a bug that exists in some combinations of  
Linux 2.4 + glibc.

Ticket #3472 identified problems in this run-time test.

http://www.sqlite.org/cvstrac/tktview?tn=3472

We have implemented changes to fix this problem.  We have tested the  
changes on OSX, Linux 2.6 and Linux 2.4.  But those are the only unix  
platforms we have access to.  We are unable to verify that our changes  
work correctly on HPUX, AIX, QNX, *BSD, and so forth.  So we are  
appealing for help for testing on those platforms.

If you have access to a unix platform other than linux and osx, please  
grab the latest sources from CVS, compile (with thread-safe enabled)  
and run the tkt3472.test test.

We are still trying to get SQLite version 3.6.5 out by about this time  
tomorrow.  We plan to release regardless of whether or not we have  
test results.  But if you find a problem, we will delay the release in  
order to fix it.

D. Richard Hipp
[EMAIL PROTECTED]



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


Re: [sqlite] Are these new functions?

2008-11-11 Thread Mauricio
Thanks. There's a nice sqlite example in the homepage
called "sqlite in 5 minutes or less". I think it would
be nice to update it to follow the recomendations on
the page you pointed me to.

Best,
M.

> http://www.sqlite.org/releaselog/3_6_0.html
> 
>>
>> I'm having  a linking problem and I  suspect that the fault  goes to the
>> version of  sqlite3 that comes  with my distribution. It's  3.5.9. These
>> functions seems to be missing: (...)

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


Re: [sqlite] Deleting sqlite rows

2008-11-11 Thread LordEricO

I have successfully queried for rowid.  For some reason, row 1 and 2 always
have rowid 1, even when I create a new database.  Do you have any idea why
that happens?


rows = new Object[0][6];
rowid = new int[0];
try {
rsmd = rs.getMetaData();
//get row data
do {
//System.out.println(rs.getRow());
other_rows = new Object[rs.getRow()-1][6];
other_rows = rows;
other_rowid = new int[rs.getRow()-1];
other_rowid = rowid;
rowid = new int[rs.getRow()];
rows = new Object[rs.getRow()][6];
for(int j = 1; j < rs.getRow(); j++){
rowid[rs.getRow()-1-j]=other_rowid[rs.getRow()-1-j];
for(int i = 1; i < 7; i++){

rows[rs.getRow()-1-j][i-1]=other_rows[rs.getRow()-1-j][i-1];

//System.out.println(rs.getRow()-1-j+""+other_rows[rs.getRow()-1-j][i]);
}
}
System.out.println(rs.getRow()+""+rs.getInt(1));
rowid[rs.getRow()-1]=rs.getInt(1);
for(int i = 1; i < 7; i++){
//System.out.println(rs.getRow());

rows[rs.getRow()-1][i-1]=getNextRow(rs,rsmd).elementAt(i);
//System.out.println(rs.getRow()+"
"+getNextRow(rs,rsmd).elementAt(i));
}
}
while (rs.next());

The bolded section always prints this out:
11
21
32
43
 I'm not sure why

Eric
-- 
View this message in context: 
http://www.nabble.com/Deleting-sqlite-rows-tp20412330p20440737.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


Re: [sqlite] SQLite3 on vxWorks

2008-11-11 Thread Shane Harrelson
I'm not certain if there is a publicly available port to the vxWorks
platform, but I know from postings to the mailing list that it has been
done.   Was there a particular problem you were encountering that we could
help with?   Were you successful at writing a VFS for that target?

-Shane

On Mon, Nov 10, 2008 at 7:31 PM, Michael Padilla <[EMAIL PROTECTED]>wrote:

> Hi,
>
> I am currently working with the porting of SQLite3 into vxWorks, but after
> a couple of weeks I have no success.
>
> Can I ask if there is any version done, which is fully compatible with
> vxWorks platform?
>
> Thank you very much
> - Michael
>
>
>
>
> ___
> 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] About sqlite3_bind

2008-11-11 Thread yoky
A parameter represents a literal. You can't bind a column name. After
binding, your query is equivalent to

select 'ID','age','name' from tbl1 where ID=1;

>   The return value of sqlite3_step(stat) was SQLITE_ROW, but the
> values I got were 0,
>   why?

Because the value of the column is a string (the same string literal you
bound to the parameter), which gets converted to int, and since it
doesn't look like an integer it gets converted to zero.

> I think maybe sqlite3_bind() can not bind the column name.

Quite.

>The reson I try to select by "select ?,?,?.. from table where ..."
> but not "select * from table where ..."

But why not

select ID, age, name where ...;

Igor Tandetnik

--

If you have that many columns but want queries with only some of them,
then it is a good indication that your schema is not normalized.  See
the wikipedia entry for some guidance:

 http://en.wikipedia.org/wiki/Database_normalization
Roger
--
--
Thanks very much!
Now my main problem is that: the time to get a whole record from a table
whit 200 columns
was too long, test in my embdded system it was about 80ms. The program is
follow:
 sqlite3_prepare(db, "select * from tbl1 where ID=id", -1,&stat,
0);   \\ ID was a primary key
 rc = sqlite3_step ( stat );
 if (SQLITE_ROW == rc)
 {
   ...
   ...\\ get column values
 }

 I want to optimize this interface to reduce the time of getting a whole
record,
 are there some advices?  or maybe the last way is  change the design to
reduce some columns.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Number Of Bugs In current version 3.6.4

2008-11-11 Thread Shane Harrelson
http://www.sqlite.org/cvstrac/timeline should give you and idea of the
number of issues reported against version 3.6.4 and/or which have been
fixed.

HTH.
-Shane



On Tue, Nov 11, 2008 at 4:33 AM, Avinash Mittal <[EMAIL PROTECTED]>wrote:

> Hi,
>
> Can someone tell me how many bugs are present in the current version
> 3.6.4.
>
> Regards
> Avinash
> ___
> 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] Are these new functions?

2008-11-11 Thread Shane Harrelson
http://www.sqlite.org/releaselog/3_6_0.html

-Shane

On Tue, Nov 11, 2008 at 6:10 AM, Mauricio <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I'm having  a linking problem and I  suspect that the fault  goes to the
> version of  sqlite3 that comes  with my distribution. It's  3.5.9. These
> functions seems to be missing:
>
> sqlite3_initialize
> sqlite3_next_stmt
> sqlite3_os_end
> sqlite3_os_init
> sqlite3_shutdown
>
> I wasn't able to find the  old version end check if those functions were
> already there. Does anyone knows  if those are new functions? If someone
> use my source with a newer  version (3.6.4), is there a risk of problems
> (since, for instance, she would not be able to call sqlite3_initialize)?
>
> Thanks,
> Maurício
>
> ___
> 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] Program crashes when delete a row in SQLite db table

2008-11-11 Thread Nithin John
Hello,

I build an application in VC++ platform and using SQLite to keep track
details that used to update when the application runs. Sometimes the
application is crashing when execte query to delete a row in a table (DELETE
FROM table where column = 'field1'). the API uses is  "sqlite3_exec()".
How can I prevent application from crashing?, Is there any thing that I
should do to make sure the SQLite DB is not corrupted?
Actually I want to delete the SQLite DB if it is corrupted as it is not a
critical data that we are storing.

The  stack trace when it crashed is shown below.

  .exe!_inflate_table()  Line 10719
  .exe!_inflate_table()  Line 32371
  .exe!_sqlite3_close()  Line 32436
  .exe!_sqlite3_declare_vtab()  Line 37373
  .exe!_sqlite3_declare_vtab()  Line 32727 + 0x6
  .exe!_sqlite3_step()  Line 32782 + 0x13
  .exe!_sqlite3_exec()  Line 50836 + 0xa


 Anyone please help me. Thanx in advance

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


[sqlite] SQLite3 on vxWorks

2008-11-11 Thread Michael Padilla
Hi,

I am currently working with the porting of SQLite3 into vxWorks, but after a 
couple of weeks I have no success.

Can I ask if there is any version done, which is fully compatible with vxWorks 
platform?

Thank you very much
- Michael



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


Re: [sqlite] Counting rows in one table, and comparing COUNT with column in other table?

2008-11-11 Thread Igor Tandetnik
"Gilles Ganault" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
> Here's an example of data in the CODE and COMPANIES tables:
>
> 
> CODE table
> id=1
> number=26
> 
> COMPANIES table
> id=x
> code=1
> 
>
> This doesn't:
> 
> SELECT code.number,COUNT(companies.code) FROM code,companies WHERE
> code.id=companies.code
> 

Add "GROUP BY code.id"

Igor Tandetnik



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


Re: [sqlite] How to build sqlite rpm package

2008-11-11 Thread Luca Olivetti
En/na Avinash Mittal ha escrit:
> Hi,
> 
> I want to build sqlite rpm package and then install it on machine.
> How can i build rpm package for sqlite using spec.template file present in
> sqlite folder ?
> what changes i need to do in spec.template for building rpm.

My advice is to check whether sqlite is already packaged for your 
distribution. If it is (most probably) and you just want a newer version 
of sqlite, check if the newer version is already available in the 
developement version of the distribution (e.g. for mandriva look in 
cooker), download the source rpm and try to rebuild it for your 
stable/old version of the same distribution.
If the new version isn't available but an older one is, download its 
source rpm and amend the spec file to use the new tarball from sqlite.org.
If it isn't packaged at all, bad luck, you'll have to try and package it 
from scratch.
Check your distribution site for instructions on how to build an rpm 
(e.g, for mandriva it is at 
http://wiki.mandriva.com/en/Development/Howto/RPM)

Bye
-- 
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004  Fax +34 93 5883007
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Recursive Query

2008-11-11 Thread MikeW
Alexander Yap <[EMAIL PROTECTED]> writes:

> 
> Hi All,
> I just want to know if WITH RECURSIVE query is supported by SQLite.
> 
> Thanks in advance.
> 
> Regards,
> 
> Alex

http://www.sqlite.org/lang_select.html

MikeW

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


[sqlite] Ticket #3461

2008-11-11 Thread Jens Miltner
Hi,

I just found another issue that looks like it might be related to  
ticket #3461:
The following query returns incorrect data for the column  
'column_56f32f43' - it seems to repeat the data from other rows for  
some rows instead of picking the correct data.


SELECT
agent_ids.AgentName AS column_10d63af1,
IFNULL((SELECT value_en FROM enum_MachineModel WHERE  
+enum_MachineModel.key=+hardware_info.MachineModel),  
hardware_info.MachineModel) AS column_31169898,
(SELECT value_en FROM enum_OSPlatform WHERE +enum_OSPlatform.key= 
+software_info.OSPlatform) AS column_56f32f43
FROM
agent_info
LEFT JOIN
agent_ids ON (Agent_Info.id=agent_ids.id)
LEFT JOIN
hardware_info ON (Agent_Info.id=hardware_info.agent_info_record_id)
LEFT JOIN
software_info ON (Agent_Info.id=software_info.agent_info_record_id)
WHERE
column_10d63af1 LIKE '%ow%' OR column_31169898 LIKE '%ow%'  OR  
column_56f32f43 LIKE '%ow%';


I tried with the latest sources from cvs and they don't reproduce the  
problem, so my assumption was that this might be the same issue as  
ticket #3461, but since I'm not sure, I thought I'd ask...

Do you want me to file another ticket for this (I can attach a small  
database that allows to reproduce the problem), or can you confirm  
that this is the same issue?

Also, since this is now the second issue we find with column aliases -  
what are the plans for a new release that fixes this issue?
(We have to decide whether to wait for the next sqlite release or  
whether to try and incorporate the fix for this problem into the 3.6.3  
sources).


Thanks,
-jens

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


[sqlite] Are these new functions?

2008-11-11 Thread Mauricio
Hi,

I'm having  a linking problem and I  suspect that the fault  goes to the
version of  sqlite3 that comes  with my distribution. It's  3.5.9. These
functions seems to be missing:

sqlite3_initialize
sqlite3_next_stmt
sqlite3_os_end
sqlite3_os_init
sqlite3_shutdown

I wasn't able to find the  old version end check if those functions were
already there. Does anyone knows  if those are new functions? If someone
use my source with a newer  version (3.6.4), is there a risk of problems
(since, for instance, she would not be able to call sqlite3_initialize)?

Thanks,
Maurício

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


[sqlite] How to build sqlite rpm package

2008-11-11 Thread Avinash Mittal
Hi,

I want to build sqlite rpm package and then install it on machine.
How can i build rpm package for sqlite using spec.template file present in
sqlite folder ?
what changes i need to do in spec.template for building rpm.

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


Re: [sqlite] Finding rows not in second table?

2008-11-11 Thread Gilles Ganault
On Sat, 8 Nov 2008 12:33:28 +0700, Dan
<[EMAIL PROTECTED]> wrote:
>That is a subjective statement. It could be true if there are a
>lot more rows in table 'Companies' than there are in 'Code' and there
>is no index on Companies.

There are indeed a lot more rows in COMPANIES than in CODE, since CODE
is just a foreign key in COMPANIES that indicates which field the
company is in, as set by the Bureau of statistics.

Thanks guys. I'll check the suggestions above and compare performance.

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


[sqlite] Number Of Bugs In current version 3.6.4

2008-11-11 Thread Avinash Mittal
Hi,

Can someone tell me how many bugs are present in the current version 3.6.4.

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


[sqlite] Counting rows in one table, and comparing COUNT with column in other table?

2008-11-11 Thread Gilles Ganault
Hello

This is a newbie question. I could successfully retrieve the results
by sending two queries and extracting data with Python, but I was
wondering if I could perform the same action in one SQLite query.

Here's an example of data in the CODE and COMPANIES tables:


CODE table
id=1
number=26

COMPANIES table
id=x
code=1


I'd like to check if there are actually as many rows in COMPANIES that
match whatever number of rows is saved CODE.number.

This works:

sql = 'SELECT id FROM code'
rows=list(cursor.execute(sql))
for id in rows:
sql = 'SELECT code.number,COUNT(companies.code) FROM code, companies
WHERE code.id="%s" AND companies.code="%s"' % (id[0],id[0])
result = list(cursor.execute(sql))
print "Code=%s, number=%s" % (id[0],result[0][0])


This doesn't:

SELECT code.number,COUNT(companies.code) FROM code,companies WHERE
code.id=companies.code


Can SQLite do what I'd like to do above, or should I just forget use
the two-step above?

Thank you for any tip.

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