1

Hi In my application I am using SQLITE database,

I want to add multiple column in table,

If i am adding one column that work fine,

I am using ALTER table for add new column,

With this i am able to update one column,

ALTER TABLE "main"."tblCredit" ADD COLUMN "CardDetail" VARCHAR

But How can i add multiple column in tblCredit table.

dmg
  • 4,231
  • 1
  • 18
  • 24
Anki
  • 589
  • 2
  • 13
  • 22
  • 1
    May be this is duplicated Question: http://stackoverflow.com/questions/6172815/sqlite-alter-table-add-multiple-columns-in-a-single-statement# – Ashvin Apr 03 '13 at 06:34
  • 1
    You can't do this as per SQLite Documentation. – Ashvin Apr 03 '13 at 06:35

2 Answers2

7

Use repeated calls to ALTER TABLE.

You should not have to do this too often anyway.

Mundi
  • 79,884
  • 17
  • 117
  • 140
  • 1
    Thanks for answer. But, We can't add the multiple column in one Alter query. Because i want add 5 column than i have to fire a 5 times alter query. – Anki Jun 18 '12 at 07:16
  • Correct. There is no other way. It is quite simple, really. Documentation [here](http://www.sqlite.org/lang_altertable.html). – Mundi Jun 18 '12 at 08:18
1

IN DB2 with the help of alter command add multiple column in table

ALTER TABLE TABLE_NAME ADD COLUMN F_NAME VARCHAR(30)
ADD COLUMN L_NAME VARCHAR(30)
ADD COLUMN ROLL_NO INTEGER
ADD COLUMN MOBILE_NUMBER VARCHAR(12);
Slava.K
  • 3,073
  • 3
  • 17
  • 28
Mohit
  • 129
  • 2
  • 3
  • 13