Page 1 of 1

SQL : Add a new Columns in a already Record

Posted: Mon Nov 14, 2005 5:35 pm
by guruk
Hi, I created a Record in my SQL DB and a ListIcon with same
table: Name, Street

Now after a While the Users add a new Column (ex. City) in my ListIcon.
SO I also like to add this new Column into my SQL DB.

How can I do without reading all Data from the DB, creating a new Table.. and save Data again with this new Column.

???

Thx
chris

Re: SQL : Add a new Columns in a already Record

Posted: Mon Nov 14, 2005 7:09 pm
by Kiffi
> SO I also like to add this new Column into my SQL DB.

Code: Select all

SQL$ = "ALTER TABLE YourTable ADD COLUMN YourNewCol TEXT"
Greetings ... Kiffi

Posted: Mon Nov 14, 2005 8:27 pm
by guruk
Servus Kiffi,

thanks a lot. I found a SQL Manual and saw its possible since V. 3. something.

But as I saw its only possible to put a new Column at the end of the record and also I can not delete a Column.

Is this right?

Great would a way to add a column at a specific position and also delete of Column like in ListIconGadget.

Thanks for Answer.
greets
chris

Posted: Tue Nov 15, 2005 8:52 am
by Kiffi
> thanks a lot. I found a SQL Manual and saw its possible since V. 3.
> something.

do we talking about SQLite?

> But as I saw its only possible to put a new Column at the end of the record
> and also I can not delete a Column.

yes, new columns can only be added at the end of the columns-collection and
you can not delete a column:
http://www.sqlite.org/omitted.html wrote: Other kinds of ALTER TABLE operations such as DROP COLUMN, ALTER
COLUMN, ADD CONSTRAINT, and so forth are omitted.
Greetings ... Kiffi