SQL : Add a new Columns in a already Record

Just starting out? Need help? Post your questions and find answers here.
guruk
User
User
Posts: 50
Joined: Thu Aug 18, 2005 2:05 pm

SQL : Add a new Columns in a already Record

Post 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
User avatar
Kiffi
Addict
Addict
Posts: 1485
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

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

Post 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
guruk
User
User
Posts: 50
Joined: Thu Aug 18, 2005 2:05 pm

Post 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
User avatar
Kiffi
Addict
Addict
Posts: 1485
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Post 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
Post Reply