Re: [sqlite] ALTER TABLE ADD COLUMN

2019-10-23 Thread x
Sent: Wednesday, October 23, 2019 2:09:19 PM To: SQLite mailing list Subject: Re: [sqlite] ALTER TABLE ADD COLUMN Wednesday, October 23, 2019, 1:53:10 PM, x wrote: > From the documentation > “A record might have fewer values than the number of columns in the > corresponding table. Th

Re: [sqlite] ALTER TABLE ADD COLUMN

2019-10-23 Thread David Raymond
space. I think it's SQLITE_ENABLE_NULL_TRIM, which is disabled by default. -Original Message- From: sqlite-users On Behalf Of x Sent: Wednesday, October 23, 2019 8:53 AM To: sqlite-users@mailinglists.sqlite.org Subject: [sqlite] ALTER TABLE ADD COLUMN From the documentation “A record might ha

Re: [sqlite] ALTER TABLE ADD COLUMN

2019-10-23 Thread Simon Slavin
On 23 Oct 2019, at 1:53pm, x wrote: > Suppose you have a table with say 5 columns that are almost always the > default value (probably zero or null). Does the above suggest you should make > them the last 5 columns in the table as the last n columns that are the > default value won’t take up

Re: [sqlite] ALTER TABLE ADD COLUMN

2019-10-23 Thread Graham Holden
Wednesday, October 23, 2019, 1:53:10 PM, x wrote: > From the documentation > “A record might have fewer values than the number of columns in the > corresponding table. This can happen, for example, after an ALTER TABLE ... > ADD COLUMN SQL statement has increased the number of > columns in

[sqlite] ALTER TABLE ADD COLUMN

2019-10-23 Thread x
From the documentation “A record might have fewer values than the number of columns in the corresponding table. This can happen, for example, after an ALTER TABLE ... ADD COLUMN SQL statement has increased the number of columns in the table schema without modifying preexisting rows in the

[sqlite] ALTER TABLE ADD COLUMN

2015-05-22 Thread Christoph P.U. Kukulies
Am 21.05.2015 um 13:44 schrieb Simon Slavin: > On 21 May 2015, at 7:51am, Christoph P.U. Kukulies > wrote: > >> Now I wonder why I don't read >> CREATE TABLE [database] ( >> [database_name] TEXT NULL, >> [table_name] TEXT NULL, >> [data_type] TEXT NULL, >> [data_size] INTEGER NULL, >>

[sqlite] ALTER TABLE ADD COLUMN

2015-05-21 Thread Kees Nuyt
On Thu, 21 May 2015 12:45:41 +0200, "Christoph P.U. Kukulies" wrote: >Am 21.05.2015 um 10:00 schrieb Kees Nuyt: >> On Thu, 21 May 2015 09:40:53 +0200, "Christoph P.U. Kukulies" >> wrote: >> >>> Am 21.05.2015 um 09:25 schrieb Hick Gunter: alter table [database] add column [real_length]

[sqlite] ALTER TABLE ADD COLUMN

2015-05-21 Thread Christoph P.U. Kukulies
Am 21.05.2015 um 10:00 schrieb Kees Nuyt: > On Thu, 21 May 2015 09:40:53 +0200, "Christoph P.U. Kukulies" > wrote: > >> Am 21.05.2015 um 09:25 schrieb Hick Gunter: >>> alter table [database] add column [real_length] numeric; >> Thanks, that did it right. Almost. Still I'm wondering why >> the

[sqlite] ALTER TABLE ADD COLUMN

2015-05-21 Thread Simon Slavin
On 21 May 2015, at 7:51am, Christoph P.U. Kukulies wrote: > Now I wonder why I don't read > CREATE TABLE [database] ( > [database_name] TEXT NULL, > [table_name] TEXT NULL, > [data_type] TEXT NULL, > [data_size] INTEGER NULL, > [column_name] TEXT NULL, > [vendor] TEXT DEFAULT 'SQLBASE'

[sqlite] ALTER TABLE ADD COLUMN

2015-05-21 Thread Christoph P.U. Kukulies
Am 21.05.2015 um 09:08 schrieb Jean-Christophe Deschamps: > At 08:51 21/05/2015, you wrote: > >> I used sqlite3.exe by invoking it on the command line with the name >> of a database. >> Next I typed >> >> alter table database add column real_length numeric; >> >> Next I typed .fullschema >> and

[sqlite] ALTER TABLE ADD COLUMN

2015-05-21 Thread Christoph P.U. Kukulies
Am 21.05.2015 um 09:25 schrieb Hick Gunter: > alter table [database] add column [real_length] numeric; Thanks, that did it right. Almost. Still I'm wondering why the output is not as "smooth" as the .fullschema listing before the ALTER ADD COLUMN: (comma at line start, lower case 'numeric')

[sqlite] ALTER TABLE ADD COLUMN

2015-05-21 Thread Jean-Christophe Deschamps
At 08:51 21/05/2015, you wrote: >I used sqlite3.exe by invoking it on the command line with the name of >a database. >Next I typed > > alter table database add column real_length numeric; > >Next I typed .fullschema >and I'm getting: > >sqlite> .fullschema >CREATE TABLE [database] (

[sqlite] ALTER TABLE ADD COLUMN

2015-05-21 Thread Christoph P.U. Kukulies
I used sqlite3.exe by invoking it on the command line with the name of a database. Next I typed alter table database add column real_length numeric; Next I typed .fullschema and I'm getting: sqlite> .fullschema CREATE TABLE [database] ( [database_name] TEXT NULL, [table_name] TEXT NULL,

[sqlite] ALTER TABLE ADD COLUMN

2015-05-21 Thread Hick Gunter
Try alter table [database] add column [real_length] numeric; -Urspr?ngliche Nachricht- Von: Christoph P.U. Kukulies [mailto:kuku at kukulies.org] Gesendet: Donnerstag, 21. Mai 2015 08:51 An: General Discussion of SQLite Database Betreff: [sqlite] ALTER TABLE ADD COLUMN I used sqlite3

Re: [sqlite] ALTER TABLE .. ADD COLUMN .. IF NOT EXISTS ..?

2014-12-16 Thread Nico Williams
On Tue, Dec 16, 2014 at 11:40:22PM +, Simon Slavin wrote: > If 'ALTER TABLE ... ADD COLUMN ...' fails it fails harmlessly, with But it doesn't fail so harmlessly: $ sqlite3 db 'alter table toy add column foo text; select 5;' || echo fail SQL Error: duplicate column name: foo fail $ Note

Re: [sqlite] ALTER TABLE .. ADD COLUMN .. IF NOT EXISTS ..?

2014-12-16 Thread Simon Slavin
On 16 Dec 2014, at 10:40pm, Nico Williams wrote: > I have a habit of putting schema definitions in a file that's always > safe to read and execute against a DB connection. This means that I > DROP some things IF EXISTS and CREATE all things IF NOT EXISTS. > > But if I

[sqlite] ALTER TABLE .. ADD COLUMN .. IF NOT EXISTS ..?

2014-12-16 Thread Nico Williams
I have a habit of putting schema definitions in a file that's always safe to read and execute against a DB connection. This means that I DROP some things IF EXISTS and CREATE all things IF NOT EXISTS. But if I have to ALTER TABLE... there's no IF NOT EXISTS .. equivalent for ALTER TABLE. Funny

Re: [sqlite] alter table add column

2011-05-31 Thread Simon Slavin
On 31 May 2011, at 5:09pm, Fabio Spadaro wrote: > Step 1: alter table pippo rename to fabio -> ok > step 2: insert into fabio (field1) values ​​('1 ') -> ko > OperationalError: no such table main.pippo How does step 2 know the name 'pippo' ? You don't seem to supply it in the command.

Re: [sqlite] alter table add column

2011-05-31 Thread Stephan Beal
On Tue, May 31, 2011 at 6:09 PM, Fabio Spadaro wrote: > To recap: > Step 1: alter table pippo rename to fabio -> ok > step 2: insert into fabio (field1) values ('1 ') -> ko > OperationalError: no such table main.pippo > Step 3: alter table add column fabio field2

Re: [sqlite] alter table add column

2011-05-31 Thread Fabio Spadaro
Hi 2011/5/31 Stephan Beal > On Tue, May 31, 2011 at 5:11 PM, Fabio Spadaro >wrote: > > > "Alter table add column" command drop data from table. > > Can you keep the data or should I store the data before the alter and > then > > put > > them in

Re: [sqlite] alter table add column

2011-05-31 Thread Stephan Beal
On Tue, May 31, 2011 at 5:11 PM, Fabio Spadaro wrote: > "Alter table add column" command drop data from table. > Can you keep the data or should I store the data before the alter and then > put > them in the table? > http://www.sqlite.org/lang_altertable.html says:

Re: [sqlite] alter table add column

2011-05-31 Thread Mr. Puneet Kishor
On May 31, 2011, at 10:11 AM, Fabio Spadaro wrote: > "Alter table add column" command drop data from table. > Can you keep the data or should I store the data before the alter and then put > them in the table? ALTER TABLE ADD COLUMN does not drop data from the table.

[sqlite] alter table add column

2011-05-31 Thread Fabio Spadaro
"Alter table add column" command drop data from table. Can you keep the data or should I store the data before the alter and then put them in the table? -- Fabio Spadaro www.fabiospadaro.com ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] ALTER TABLE ADD COLUMN - strange behaviour....Mac OSX

2007-06-03 Thread Nuno Lucas
On 6/3/07, Mark Gilbert <[EMAIL PROTECTED]> wrote: Anyone have *any* idea what is happening ? I don't know nothing about MacOS, but you may want to check the result of sqlite3_close. It's possible it's not closing the database [1]. Regards, ~Nuno Lucas [1]

[sqlite] ALTER TABLE ADD COLUMN - strange behaviour....Mac OSX

2007-06-03 Thread Mark Gilbert
Folks. I had been struggling to implement ALTER TABLE ADD COLUMN in my app to change the database structure. However I would continuously face a locked database error. After much experimentation I have come to a very very strange conclusion. In my app if I do this: -start app -open

Re: [sqlite] ALTER TABLE ... ADD COLUMN crashes with too many columns

2005-03-29 Thread D. Richard Hipp
On Tue, 2005-03-29 at 03:13 -0800, Andy Lutomirski wrote: > I can crash sqlite3 like this: > > % cat test.sql > create table a (id INTEGER PRIMARY KEY); > alter table a add column f1 TEXT; > alter table a add column f2 TEXT; > alter table a add column f3 TEXT; > alter table a add column f4 TEXT;

[sqlite] ALTER TABLE ... ADD COLUMN crashes with too many columns

2005-03-29 Thread Andy Lutomirski
I can crash sqlite3 like this: % cat test.sql create table a (id INTEGER PRIMARY KEY); alter table a add column f1 TEXT; alter table a add column f2 TEXT; alter table a add column f3 TEXT; alter table a add column f4 TEXT; alter table a add column f5 TEXT; alter table a add column f6 TEXT; alter