syntax error in alter table add column

got a syntax error saying near "," while compile in the following code:

db.execSQL("ALTER TABLE " + TABLE_NAME + " ADD " + TOADD1 + " VARCHAR," + TOADD2 + " VARCHAR," 
                + TOADD3 + " VARCHAR");

Where is the syntax error?

Thanks in advance.

Answers


ALTER TABLE supports only adding one column at a time as seen in the syntax diagram:

If you need to add three columns, split it to three separate ALTER TABLEs.


Need Your Help

JAXB XmlJavaTypeAdapter unmarshal method not being called

xml-parsing jaxb

I am trying to marshal/unmarshal a Color to XML. The JAXB project had example code for doing this exact thing via a XmlJavaTypeAdapter

Variable sent with AJAX is undefined in PHP

javascript php jquery ajax

I'm trying to send a variable from Javascript to PHP using AJAX.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.