Re: [sqlite] Rowid alias and description of query result: suspected tiny bug

2019-03-17 Thread Keith Medcalf
On Sunday, 17 March, 2019 15:00, Yannick Duchêne wrote: >Aside, what also surprised me just a moment ago and I never >noticed before, is that although I can refer to ROWID (not aliased) >anywhere in a query, it seems to not work properly in `using(rowid)`, if >the ROWID is automatically

Re: [sqlite] Rowid alias and description of query result: suspected tiny bug

2019-03-17 Thread Yannick Duchêne
On Sun, 17 Mar 2019 14:27:19 -0600 "Keith Medcalf" wrote: > > specifies the name you want to appear for the first column. The other names > for the other four columns are free to be whatever they want ... that is, > without an AS clause, the column names are not guaranteed to be anything >

Re: [sqlite] Rowid alias and description of query result: suspected tiny bug

2019-03-17 Thread Keith Medcalf
On Sunday, 17 March, 2019 12:30, Yannick Duchêne wrote: >Hi people, it’s a long time I did not get there. >I’m currently to create and use an SQLite DB with the Python biding >APSW. For each row returned, I always retrieve the description with >`Cursor.getdescription()`. Surprisingly, during

[sqlite] Rowid alias and description of query result: suspected tiny bug

2019-03-17 Thread Yannick Duchêne
Hi people, it’s a long time I did not get there. I’m currently to create and use an SQLite DB with the Python biding APSW. For each row returned, I always retrieve the description with `Cursor.getdescription()`. Surprisingly, during a test, I noticed the name of a column as returned in the

Re: [sqlite] ROWID....

2018-06-09 Thread Keith Medcalf
about anticipated traffic volume. >-Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Luuk >Sent: Saturday, 9 June, 2018 05:04 >To: SQLite mailing list >Subject: [sqlite] ROWID > > >In the d

Re: [sqlite] ROWID....

2018-06-09 Thread Paul Sanderson
As ROWID is often an alias for an integer primary key then it needs to be able to represent both negaitive and positive integers other wise you restrict the range of an integer PK. Paul www.sandersonforensics.com SQLite Forensics Book On 9 June

Re: [sqlite] ROWID....

2018-06-09 Thread Kevin Benson
On Sat, Jun 9, 2018 at 7:03 AM Luuk wrote: > > In the docs (https://www.sqlite.org/autoinc.html) it says: > In SQLite, table rows normally have a 64-bit signed integer ROWID > > > Question: > Why it this a signed integer, and not an

[sqlite] ROWID....

2018-06-09 Thread Luuk
In the docs (https://www.sqlite.org/autoinc.html) it says: In SQLite, table rows normally have a 64-bit signed integer ROWID Question: Why it this a signed integer, and not an unsigned integer? Simply by choice? of is there something

Re: [sqlite] rowid as foreign key

2017-07-24 Thread Roman Fleysher
link them. Perhaps I will use ALTER TABLE mechanism. Roman From: sqlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf of Keith Medcalf [kmedc...@dessus.com] Sent: Monday, July 24, 2017 6:58 PM To: SQLite mailing list Subject: Re: [sql

Re: [sqlite] rowid as foreign key

2017-07-24 Thread Keith Medcalf
gt;To: General Discussion of SQLite Database >Subject: [sqlite] rowid as foreign key > >Dear SQLiters, > >Is it possible to link two tables using rowid, the implicit column? I >tried and it did not work, so I presume the answer to my question is >"no". > >Thank you, >

Re: [sqlite] rowid as foreign key

2017-07-24 Thread Roman Fleysher
lite-users-boun...@mailinglists.sqlite.org] on behalf of Gwendal Roué [gwendal.r...@gmail.com] Sent: Monday, July 24, 2017 3:17 PM To: SQLite mailing list Subject: Re: [sqlite] rowid as foreign key > Le 24 juil. 2017 à 20:58, Roman Fleysher <roman.fleys...@einstein.yu.edu> a > écr

Re: [sqlite] rowid as foreign key

2017-07-24 Thread Gwendal Roué
> Le 24 juil. 2017 à 20:58, Roman Fleysher a > écrit : > > Dear SQLiters, > > Is it possible to link two tables using rowid, the implicit column? I tried > and it did not work, so I presume the answer to my question is "no". Hello Roman, The answer is yes.

[sqlite] rowid as foreign key

2017-07-24 Thread Roman Fleysher
Dear SQLiters, Is it possible to link two tables using rowid, the implicit column? I tried and it did not work, so I presume the answer to my question is "no". Thank you, Roman ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] rowid changing....

2016-09-19 Thread Dominique Devienne
On Sun, Sep 18, 2016 at 4:19 PM, mikeegg1 wrote: > Thanks everyone. I was mis-equating REPLACE with UPDATE. I’ll change my > code to “INSERT or IGNORE” and add an UPDATE. > For info, that's a common gotcha with SQLite. See [1] from 2-months ago, but I'm sure the archives are

Re: [sqlite] rowid changing....

2016-09-18 Thread mikeegg1
Thanks everyone. I was mis-equating REPLACE with UPDATE. I’ll change my code to “INSERT or IGNORE” and add an UPDATE. Mike > On Sep 18, 2016, at 05:34, Keith Medcalf wrote: > > > On Saturday, 17 September, 2016 21:35, mikeeggl asked: > >> In my DDL I have “integer

Re: [sqlite] rowid changing....

2016-09-18 Thread Keith Medcalf
On Saturday, 17 September, 2016 21:35, mikeeggl asked: > In my DDL I have “integer primary key not null” on my tables. When I do > the first insert to these tables the rowid is assigned. The insert > statement is a “insert or replace into…” so I don’t have to deal with > insertion errors.

Re: [sqlite] rowid changing....

2016-09-18 Thread Simon Slavin
On 18 Sep 2016, at 7:21am, Clemens Ladisch wrote: > mikeegg1 wrote: >> The insert statement is a “insert or replace into…” so I don’t have to >> deal with insertion errors. However, I expected the rowid to not change >> when the row has not changed. > > The OR REPLACE

Re: [sqlite] rowid changing....

2016-09-18 Thread Clemens Ladisch
mikeegg1 wrote: > The insert statement is a “insert or replace into…” so I don’t have to > deal with insertion errors. However, I expected the rowid to not change > when the row has not changed. The OR REPLACE clause just deletes any old row. If you want to update the old row, use UPDATE. (And

[sqlite] rowid changing....

2016-09-17 Thread mikeegg1
Happy Saturday. In my DDL I have “integer primary key not null” on my tables. When I do the first insert to these tables the rowid is assigned. The insert statement is a “insert or replace into…” so I don’t have to deal with insertion errors. However, I expected the rowid to not change when

[sqlite] ROWID schema surgery

2016-02-26 Thread Tristan Seligmann
On Fri, 26 Feb 2016 at 16:42 Simon Slavin wrote: > > I thought I knew where it was documented but I can't find it at the > moment. The idea is that if you have given the column an explicit name (in > your case 'storeID') then you might be referring to it in your code, so > SQLite shouldn't

[sqlite] ROWID schema surgery

2016-02-26 Thread Simon Slavin
On 26 Feb 2016, at 2:22pm, Tristan Seligmann wrote: > PRAGMA writable_schema=on; > UPDATE sqlite_master SET sql='CREATE TABLE some_table_name (..., storeID > INTEGER PRIMARY KEY)' WHERE tbl_name='some_table_name'; I thought I knew where it was documented but I can't find it at the moment.

[sqlite] ROWID schema surgery

2016-02-26 Thread Tristan Seligmann
Axiom is an ORM'ish layer on top of SQLite in Python. Due to unfortunate historic reasons, Axiom relies on the implicit ROWID (actually "oid") column present in every table in SQLite, without declaring an explicit PRIMARY KEY; this, of course, means that VACUUMing an Axiom table will corrupt it as

[sqlite] ROWID schema surgery

2016-02-26 Thread Richard Hipp
On 2/26/16, Tristan Seligmann wrote: > > PRAGMA writable_schema=on; > UPDATE sqlite_master SET sql='CREATE TABLE some_table_name (..., storeID > INTEGER PRIMARY KEY)' WHERE tbl_name='some_table_name'; > I don't think that will work. I believe you are going to need to copy the table content.

Re: [sqlite] ROWID-based queries slow in FTS db

2015-01-30 Thread farkas andras
Thank you for the quick fix and the info, I will wait for 3.8.9 to trickle down into DBD::SQLite. AF Dan Kennedy írta: >On 01/30/2015 10:49 PM, Dominique Devienne wrote: >> On Fri, Jan 30, 2015 at 4:38 PM, Dan Kennedy wrote: >> >>> On 01/29/2015

Re: [sqlite] ROWID-based queries slow in FTS db

2015-01-30 Thread Dan Kennedy
On 01/30/2015 10:49 PM, Dominique Devienne wrote: On Fri, Jan 30, 2015 at 4:38 PM, Dan Kennedy wrote: On 01/29/2015 02:29 AM, farkas andras wrote: [...] but searches based on ROWID are atrociously slow and hog massive amounts of memory [...] Looks like range

Re: [sqlite] ROWID-based queries slow in FTS db

2015-01-30 Thread Dominique Devienne
On Fri, Jan 30, 2015 at 4:38 PM, Dan Kennedy wrote: > On 01/29/2015 02:29 AM, farkas andras wrote: > >> [...] but searches based on ROWID are atrociously slow and hog massive >> amounts of memory [...] >> > > Looks like range constraints on rowids were only taken into

Re: [sqlite] ROWID-based queries slow in FTS db

2015-01-30 Thread Dan Kennedy
On 01/29/2015 02:29 AM, farkas andras wrote: Hi all, Im using FTS through DBD::SQLite (perl) to query large text databases (~10GB, ~10 million records). The regular FTS MATCH searches work fine (they usually run under a second), but searches based on ROWID are atrociously slow and hog massive

[sqlite] ROWID-based queries slow in FTS db

2015-01-28 Thread farkas andras
Hi all, Im using FTS through DBD::SQLite (perl) to query large text databases (~10GB, ~10 million records). The regular FTS MATCH searches work fine (they usually run under a second), but searches based on ROWID are atrociously slow and hog massive amounts of memory. Im trying to retrieve a

Re: [sqlite] rowid question

2014-05-08 Thread Alain Meunier
Ok thanks ! > To: sqlite-users@sqlite.org > From: i...@tandetnik.org > Date: Thu, 8 May 2014 09:51:56 -0400 > Subject: Re: [sqlite] rowid question > > On 5/8/2014 4:57 AM, Alain Meunier wrote: > > Are there any way to insert a row at a specified rowid ? > > Jus

Re: [sqlite] rowid question

2014-05-08 Thread Igor Tandetnik
On 5/8/2014 4:57 AM, Alain Meunier wrote: Are there any way to insert a row at a specified rowid ? Just mention rowid in your INSERT statement, the same way you would any other field: insert into myTable(rowid, otherFields) values(42, 'otherValues'); Is there a way to do it without having

Re: [sqlite] rowid question

2014-05-08 Thread Simon Slavin
On 8 May 2014, at 9:57am, Alain Meunier wrote: > Are there any way to insert a row at a specified rowid ? > > Imagine that i wish to insert a row at rowid 9 then 1150; Is it possible ? Declare a table column as INTEGER PRIMARY KEY. This will make the 'rowid' pseudocolumn

[sqlite] rowid question

2014-05-08 Thread Alain Meunier
Hello, Are there any way to insert a row at a specified rowid ? Imagine that i wish to insert a row at rowid 9 then 1150; Is it possible ? Is there a way to do it without having an index (storage space) ? Thanks

Re: [sqlite] rowid column as a FOREIGN KEY

2010-08-23 Thread Oliver Peters
Pavel Ivanov writes: > > > I can't understand why is it a bad practice to use database-provided >>features? > > You can use it when you are selecting. And even in this case you > should use caution because without explicit column declared by you > SQLite can change rowids without

Re: [sqlite] rowid column as a FOREIGN KEY

2010-08-23 Thread Pavel Ivanov
> I can't understand why is it a bad practice to use database-provided features? You can use it when you are selecting. And even in this case you should use caution because without explicit column declared by you SQLite can change rowids without notice. And for foreign keys it's mandatory to

Re: [sqlite] rowid column as a FOREIGN KEY

2010-08-23 Thread inst
> Make it your rule of thumb: don't ever use rowid, declare your own > column as "integer primary key" and use it. It will come at no cost > for you and everything else will work much better. I just wanted to write less text in my queries. I can't understand why is it a bad practice to use

Re: [sqlite] rowid column as a FOREIGN KEY

2010-08-23 Thread Pavel Ivanov
Make it your rule of thumb: don't ever use rowid, declare your own column as "integer primary key" and use it. It will come at no cost for you and everything else will work much better. Here is simplified example of your problem and solution: sqlite> pragma foreign_keys=on; sqlite> create table t

Re: [sqlite] rowid column as a FOREIGN KEY

2010-08-23 Thread inst
Thanks for your answer, Oliver. > http://www.sqlite.org/foreignkeys.html Yes, I have already read this before mailing here. > PRAGMA foreign_keys Yes, I knew about this PRAGMA. Ok, I'll try to describe my problem with one example. Imagine we have to store information about pages and the

Re: [sqlite] rowid column as a FOREIGN KEY

2010-08-23 Thread Oliver Peters
inst writes: > > Do anyone encounter this problem or I just did something wrong? > If you've an example (CREATE & INSERT/DELETE statements or whatever clarifies what you do) the possibility that someone can give you a quick and meaningful answer will increase enormous. My

[sqlite] rowid column as a FOREIGN KEY

2010-08-23 Thread inst
Hi, Recently I've found one problem in SQLite and I think that this is a bug. Are there any ways to use rowid column in one table as a foreign key in another? By the rowid I mean internal column that used as an alias for INTEGER PRIMARY KEY columns. As described at documents, SQLite supports

Re: [sqlite] rowid availability from views is inconsistent

2010-03-12 Thread Alexey Pechnikov
Hello! On Friday 12 March 2010 11:47:40 Ben Harper wrote: > Is there some recommended workaround that I can use to ensure that I always > get non-null rowids with every VIEW? > > CREATE TABLE one (i32 INTEGER); > INSERT INTO one VALUES(100); > INSERT INTO one VALUES(200); > CREATE VIEW v1 AS

Re: [sqlite] rowid availability from views is inconsistent

2010-03-12 Thread Ben Harper
: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: 12 March 2010 11:54 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] rowid availability from views is inconsistent On 12 Mar 2010, at 8:47am, Ben Harper wrote: > Under cert

Re: [sqlite] rowid availability from views is inconsistent

2010-03-12 Thread Simon Slavin
On 12 Mar 2010, at 8:47am, Ben Harper wrote: > Under certain conditions, VIEWs do not have rowid values. > > Is there some recommended workaround that I can use to ensure that I always > get non-null rowids with every VIEW? > > CREATE TABLE one (i32 INTEGER); > INSERT INTO one VALUES(100); >

[sqlite] rowid availability from views is inconsistent

2010-03-12 Thread Ben Harper
Under certain conditions, VIEWs do not have rowid values. Is there some recommended workaround that I can use to ensure that I always get non-null rowids with every VIEW? CREATE TABLE one (i32 INTEGER); INSERT INTO one VALUES(100); INSERT INTO one VALUES(200); CREATE VIEW v1 AS SELECT *

Re: [sqlite] rowid of the current insert

2009-12-14 Thread Tim Romano
You basically have this structure: MOVIES movieid, title PEOPLE peopleid, name MOVIEPEOPLE movieid, peopleid, role You insert a row into MOVIES and then insert one or more rows into PEOPLE and then you want to associate people with a movie in your MOVIESPEOPLE table. In order to do this,

Re: [sqlite] rowid of the current insert

2009-12-14 Thread Yuzem
Tim Romano wrote: > > You should keep your id and the imdbid in separate columns, because you > can then insert a title even if IMDB does not have it yet. > Ok, I have thought about this and it will be probably simpler to have two separated ids than using a trigger. Now, there are some

Re: [sqlite] rowid of the current insert

2009-12-10 Thread Tim Romano
You should keep your id and the imdbid in separate columns, because you can then insert a title even if IMDB does not have it yet. id INTEGER PRIMARY KEY imdbid integer// you should allow this column to be null title not null, et cetera Regards Tim Romano Yuzem wrote: > CREATE TABLE

Re: [sqlite] rowid of the current insert

2009-12-10 Thread Simon Davies
2009/12/10 Yuzem : > > CREATE TABLE movies(id integer,title text,unique(id)) > > Generally I have an unique id from imdb but some times the movie isn't > available. > I understand that there is a column called rowid that is the primary key. > I would like to insert the rowid

[sqlite] rowid of the current insert

2009-12-10 Thread Yuzem
CREATE TABLE movies(id integer,title text,unique(id)) Generally I have an unique id from imdb but some times the movie isn't available. I understand that there is a column called rowid that is the primary key. I would like to insert the rowid on the id column when I don't have an id for the

Re: [sqlite] ROWID bug in SELECT with JOIN?

2009-09-25 Thread BareFeet
On 26/09/2009, at 7:35 AM, sub sk79 wrote: > Select with two tables joined has no _rowid_ column in select columns. > I think this is a bug - just a quick check with the community before > filing a bug report. > > select * from names, friends where first_name = fname and _rowid_ < 2; > SQL error:

Re: [sqlite] ROWID bug in SELECT with JOIN?

2009-09-25 Thread Igor Tandetnik
sub sk79 wrote: > select * from (select * from names, friends where first_name = fname) > where _rowid_ < 2; > > Above query works - which _rowid_ is this accessing? Well, define "works". In my experiments, _rowid_ is NULL for all rows in the subselect: select

Re: [sqlite] ROWID bug in SELECT with JOIN?

2009-09-25 Thread sub sk79
select * from (select * from names, friends where first_name = fname) where _rowid_ < 2; Above query works - which _rowid_ is this accessing? Since the query works I get an impression the rowid is attached with the result-set returned by a select? -sk On Fri, Sep 25, 2009 at 6:07 PM, Igor

Re: [sqlite] ROWID bug in SELECT with JOIN?

2009-09-25 Thread Igor Tandetnik
sub sk79 wrote: > Select with two tables joined has no _rowid_ column in select columns. > I think this is a bug - just a quick check with the community before > filing a bug report. > > select * from names, friends where first_name = fname and _rowid_ < 2; > SQL error: no such

Re: [sqlite] ROWID of 0

2009-06-26 Thread D . Richard Hipp
On Jun 26, 2009, at 12:22 PM, D. Richard Hipp wrote: > > On Jun 26, 2009, at 12:13 PM, Shaun Seckman (Firaxis) wrote: > >> I have a column ("ID") in a table that is the primary key integer >> so it >> should be an alias for ROWID. Is it safe to have a ROWID of 0? > > > A ROWID can have any

Re: [sqlite] ROWID of 0

2009-06-26 Thread Dan
On Jun 26, 2009, at 11:13 PM, Shaun Seckman (Firaxis) wrote: > I have a column ("ID") in a table that is the primary key integer so > it > should be an alias for ROWID. Is it safe to have a ROWID of 0? Yes. > > > > > -Shaun > > > > > > ___ >

Re: [sqlite] ROWID of 0

2009-06-26 Thread D. Richard Hipp
On Jun 26, 2009, at 12:13 PM, Shaun Seckman (Firaxis) wrote: > I have a column ("ID") in a table that is the primary key integer so > it > should be an alias for ROWID. Is it safe to have a ROWID of 0? A ROWID can have any value between -9223372036854775808 and 9223372036854775807,

[sqlite] ROWID of 0

2009-06-26 Thread Shaun Seckman (Firaxis)
I have a column ("ID") in a table that is the primary key integer so it should be an alias for ROWID. Is it safe to have a ROWID of 0? -Shaun ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] rowid for my first 2 rows is always the Same.

2008-11-15 Thread Igor Tandetnik
"LordEricO" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > For some reason, the rowid of the first the 2 rows in my table always > matches. Whether it's one and one, two and two, 20 and 20 etc... No > matter if I delete one of the rows. > Do you know why that would be? With all

[sqlite] rowid for my first 2 rows is always the Same.

2008-11-15 Thread LordEricO
For some reason, the rowid of the first the 2 rows in my table always matches. Whether it's one and one, two and two, 20 and 20 etc... No matter if I delete one of the rows. Do you know why that would be? Eric -- View this message in context:

Re: [sqlite] rowid increment

2008-10-29 Thread Simon Davies
2008/10/29 Shaun R. <[EMAIL PROTECTED]>: > The rowid looks to reuse numbers when a row is deleted, how can i stop this? > > For example, i insert 3 rows, then i delete row 2, when entering a new row > after that the rowid is 2 rather than 4. I want the rowid to be 4. use AUTOINCREMENT keyword:

Re: [sqlite] rowid increment

2008-10-29 Thread Chris Peachment
Use an autoincrement field in the table instead. On Wed, 2008-10-29 at 09:46 -0700, Shaun R. wrote: > The rowid looks to reuse numbers when a row is deleted, how can i stop this? > > For example, i insert 3 rows, then i delete row 2, when entering a new row > after that the rowid is 2 rather

Re: [sqlite] rowid increment

2008-10-29 Thread Igor Tandetnik
Shaun R. <[EMAIL PROTECTED]> wrote: > The rowid looks to reuse numbers when a row is deleted, how can i > stop this? create table t(id integer primary key autoincrement, ...); http://sqlite.org/autoinc.html Igor Tandetnik ___ sqlite-users mailing

[sqlite] rowid increment

2008-10-29 Thread Shaun R.
The rowid looks to reuse numbers when a row is deleted, how can i stop this? For example, i insert 3 rows, then i delete row 2, when entering a new row after that the rowid is 2 rather than 4. I want the rowid to be 4. ~Shaun ___ sqlite-users

[sqlite] Rowid After Sorting

2008-03-26 Thread Mahalakshmi.m
Dennis Cote wrote: >Then you should add an index on the Name column and use that to process >your queries in Name order more quickly. >create index on MyTable(Name); Thanks a lot Dennis. My process is more fast by means indexing. Dennis Cote wrote: >If you really insist on reordering your

Re: [sqlite] Rowid After Sorting

2008-03-25 Thread Mahalakshmi.m
Dennis Cote wrote: >Then you should add an index on the Name column and use that to process >your queries in Name order more quickly. >create index on MyTable(Name); Thanks a lot Dennis. My process is more fast by means indexing. Dennis Cote wrote: >If you really insist on reordering your

Re: [sqlite] Rowid After Sorting

2008-03-25 Thread Dennis Cote
Mahalakshmi.m wrote: > > I wish to perform all operations in my code with sorted order of the Name > field. > Then you should add an index on the Name column and use that to process your queries in Name order more quickly. create index on MyTable(Name); If you really insist on reordering

[sqlite] Rowid After Sorting

2008-03-24 Thread Mahalakshmi.m
1) SELECT rowid,Id,Name FROM MyTable ORDER BY Name; Rowid Id Name 4 4 aaa 3 3 bbb 2 2 xxx 1 1 zzz 2) "create table Temp as select Name from Mytable order by Name;" RowidId Name 1 4

Re: [sqlite] Rowid After Sorting

2008-03-17 Thread Paul Smith
> >But I need my rowid to be chaged as follows. > >Rowid Id Name >1 4 aaa >2 3 bbb >3 2 xxx >4 1 zzz You can't. Rowid isn't an index of where the row appeared in the results, it's a 'hidden' field in each row in the

Re: [sqlite] Rowid After Sorting

2008-03-17 Thread dan.winslow
Why do you need your rowid to be changed? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mahalakshmi.m Sent: Friday, March 14, 2008 1:03 AM To: sqlite-users@sqlite.org Subject: [sqlite] Rowid After Sorting Hi, I am working in 3.3.6 and my table looks

Re: [sqlite] Rowid After Sorting

2008-03-14 Thread John Stanton
The rowid is the b-tree key for the row. You cannot change it. Mahalakshmi.m wrote: > Hi, > > I am working in 3.3.6 and my table looks like. > > > > Id - Integer Primary Key > > Name- Text > > > > Id Name > > 1 zzz > > 2

Re: [sqlite] Rowid After Sorting

2008-03-14 Thread Bharath Booshan L
> But I need my rowid to be chaged as follows. > > > > Rowid Id Name > > > > 1 4 aaa > > 2 3 bbb > > 3 2 xxx > > 4 1 zzz If you are looking Rowid to contain serial numbers every time then you can query for only

[sqlite] Rowid After Sorting

2008-03-14 Thread Mahalakshmi.m
Hi, I am working in 3.3.6 and my table looks like. Id - Integer Primary Key Name- Text Id Name 1 zzz 2 xxx 3 bbb 4 aaa SELECT rowid,Id,Name FROM MyTable ORDER

Re: [sqlite] rowid value

2008-03-10 Thread David McDivitt
Thanks Igor. That solved my problem. >From: [EMAIL PROTECTED] >To: >Date: 3/10/2008 11:53:47 AM > >http://sqlite.org/lang_createtable.html >Search this page for ROWID. >Igor tandetnik ___ sqlite-users mailing list

[sqlite] rowid value

2008-03-10 Thread David McDivitt
I just began using SQLite. I have an iPhone and want to write a Windows application to edit the database. After finding the database to be SQLite and researching SQLite, I made a good start at the application. I really like SQLite! It's the first alternative I've seen to Microsoft Jet, which is

Re: [sqlite] rowid versus docid for fts3.

2007-09-02 Thread Ralf Junker
Scott Hess wrote: >Unfortunately, the reason fts2 couldn't be "fixed" was because you >can't perform the necessary ALTER TABLE if the column you're adding is >a primary key. Sure, I was aware of this problem. >Since the only alternative would be to build a new >table and copy everything over,

Re: [sqlite] rowid versus docid for fts3.

2007-08-31 Thread Scott Hess
Unfortunately, the reason fts2 couldn't be "fixed" was because you can't perform the necessary ALTER TABLE if the column you're adding is a primary key. Since the only alternative would be to build a new table and copy everything over, it seemed more reasonable to just let the app developer do

Re: [sqlite] rowid versus docid for fts3.

2007-08-31 Thread Joe Wilson
--- Ralf Junker <[EMAIL PROTECTED]> wrote: > This one just came to my mind: > > CREATE TABLE (rowid INTEGER PRIMARY KEY, t TEXT); > > This promotes "rowid" to a visible column "rowid" which does not change > during a VACUUM. "rowid" > is already a reserved word in SQLite. Maybe this option is

Re: [sqlite] rowid versus docid for fts3.

2007-08-31 Thread Ralf Junker
This one just came to my mind: CREATE TABLE (rowid INTEGER PRIMARY KEY, t TEXT); This promotes "rowid" to a visible column "rowid" which does not change during a VACUUM. "rowid" is already a reserved word in SQLite. Maybe this option is even compatible to FTS2? Ralf >ext/fts3.c in the

[sqlite] rowid versus docid for fts3.

2007-08-30 Thread Scott Hess
ext/fts3.c in the current code fixes the fts2-vs-vacuum problem by adding "docid INTEGER PRIMARY KEY" to the %_content table. This becomes an alias for rowid, and thus causes vacuum to not renumber rowids. It is safe to add that column because the other columns in %_content are constructed such

Re: [sqlite] ROWID

2006-04-12 Thread drh
"Brian Johnson" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > > "Brian Johnson" <[EMAIL PROTECTED]> wrote: > > > Why does a INTEGER PRIMARY KEY field autoincrement when inserting a NULL > > > into > > > that field as per http://www.sqlite.org/faq.html#q1 and a field defined > > >

Re: [sqlite] ROWID

2006-04-12 Thread Brian Johnson
[EMAIL PROTECTED] wrote: > > "Brian Johnson" <[EMAIL PROTECTED]> wrote: > > Why does a INTEGER PRIMARY KEY field autoincrement when inserting a NULL > > into > > that field as per http://www.sqlite.org/faq.html#q1 and a field defined as > > int > > primary key not work the same way? > > Because

Re: [sqlite] ROWID

2006-04-12 Thread drh
"Brian Johnson" <[EMAIL PROTECTED]> wrote: > I have a few questions about autoincrement and RowID that I couldn't google an > answer > > I have a database for hardware with limited ram (and flash ram) so I'd like to > use as little ram as possible. > > Is there any difference between the hidden

[sqlite] ROWID

2006-04-12 Thread Brian Johnson
I have a few questions about autoincrement and RowID that I couldn't google an answer I have a database for hardware with limited ram (and flash ram) so I'd like to use as little ram as possible. Is there any difference between the hidden field rowid and a field defined as INTEGER PRIMARY KEY?

Re: [sqlite] rowId continuity?

2005-09-14 Thread Jay Sprenkle
Why not use another column? Provide sorted data for your users in some way that provides them with more value. On 9/14/05, R S <[EMAIL PROTECTED]> wrote: > > Hi, > I have a screen which displays rows of my table in a paged form (i.e. one > can do Back/Previous on them and navigate across

[sqlite] rowId continuity?

2005-09-14 Thread R S
Hi, I have a screen which displays rows of my table in a paged form (i.e. one can do Back/Previous on them and navigate across pages). I use the rowId of the top and bottom rows to query for the next/previous set of rows in the page. However I just read somewhere that the rowId need not be

Re: [sqlite] Rowid in VIEWs?

2004-08-23 Thread Christian Smith
On Tue, 17 Aug 2004, Keith Herold wrote: >The short question: do (temporary) VIEW's have rowid's in SQLITE? > >A small description of the problem: > > ... On occasion, the result is quite large, and my standard way >of returning results is very slow on large result sets, so I try to >break up

RE: [sqlite] Rowid in VIEWs?

2004-08-18 Thread Keith Herold
PROTECTED] Sent: Wednesday, August 18, 2004 11:29 AM To: [EMAIL PROTECTED] Subject: Re: [sqlite] Rowid in VIEWs? Keith Herold wrote: > The short question: do (temporary) VIEW's have rowid's in SQLITE? The short answer: no. You don't say how you are accessing the database, but if you are usin

Re: [sqlite] Rowid in VIEWs?

2004-08-18 Thread Dennis Cote
Keith Herold wrote: > The short question: do (temporary) VIEW's have rowid's in SQLITE? The short answer: no. You don't say how you are accessing the database, but if you are using C, then you can simply use the precompiled query interface to perform your lookup and return your result in small

[sqlite] Rowid in VIEWs?

2004-08-17 Thread Keith Herold
The short question: do (temporary) VIEW's have rowid's in SQLITE? A small description of the problem: I have a small database of values, where I would like users to be able to execute simple filters (as (Key,Value) pairs) to return a subset of the data. On occasion, the result is quite large,

[sqlite] rowid vs integer primary key

2003-12-17 Thread Derrell . Lipman
Is there any reason to specify an INTEGER PRIMARY KEY field in a table, if it is going to be used solely as an auto-increment field? Isn't an integer primary key which is auto-incrementing in reality exactly the same as using ROWID? I guess my question is really, if I'm using rowid as my