> Bert Verhees wrote: > > > > The workaround for ALTER TABLE is not useable in SQL-code generating > > environments. > > Sorry for being dense, but can you elaborate on the above? Why can't > such code be generated?
Let me explain, I guess I did no express myself clear. There is quit some SQL-generating software (like MDA*-software, but also all kind of GUI's for databases, and these kind of GUI's can be everywhere in many kinds of software), and that software expects that the most fundamental SQL is understood. It expects the engine to be able to create, drop and alter tables/indices, and it expects the engine to support common datatypes, and common select/join- constructions. This software is not prepared for workarounds because an engine has an omision like not understanding ALTER TABLE. As far as I know is SQLite the only sql-engine which does not understand ALTER TABLE. It causes me a lot of trouble. I am even writing a small converting-programm which converts an SQLite-database to a Firebird database (inclusive data). Let the Firebird-database be manipulated by the SQL-generating and SQL-manipulating software (MDA), and convert it back to the SQLite database, then switch the connectors back to SQLite and in that way fool the MDA so it thinks it had changed the SQLite database, and I can go on with my work. I hope I expressed myself clear now. Regards Bert Verhees (MDA is Model Driven Architecture, this is software which let you design software in UML and OCL (sometimes exaggerated called "executable UML"), and then creates and generates a database for you. When you change the UML-scheme, the software changes the database for you, and tries not to loose data. Here it calls ALTER TABLE, sometimes it does this in steps, because when done intelligent less or no data will fall out of their context. It also has the possiblity to check data, and meta-data in the database, and finds out if all works consistent. I makes heavily use of EXISTS when doing this. The SQL-used hereby is hard- coded in the MDA software and is only for parts to define by the user, which is understandable because that software cannot be prepared for all kind of syntax- contructions that are caused by user-defined settings.)