[Gambas-user] Sqlite, Delete field from table

Johny Provoost johny.provoost at ...27...
Mon Oct 19 17:38:37 CEST 2015


Hallo,

Is it possible to delete a field in a table from a SQLite database 
through gambas code?

with
   FMain.tmpSQL = "ALTER TABLE " & FMain.lstTables.Text & " ADD " & 
FieldNew.txtFieldname.Text & " " & FieldNew.cmbFieldType.Text
   FMain.openSQL = FMain.$hConnLocl.EXEC(FMain.tmpSQL)

I can add a new field, but if I replace " ADD " with DEL or DELETE, I 
get errors.  I search the internet, but found nothing to delete directly 
the field.

There's always a workaround through create tmp table, copy the fields to 
save to it, delete the old table and rename the tmp table back to old 
table.  But if it is can be done directly it is much easier.

-- 



*Vriendelijke Groeten*

*Johny Provoost*

*mailto: johny.provoost at ...27... <mailto:johny.provoost at ...27...>*

*mailto: johny.provoost at ...626... <mailto:johny.provoost at ...626...>*

*Website:* *http://www.johnyprovoost.net* <http://www.johnyprovoost.net/>






More information about the User mailing list