Subject Re: How to update table structure with SQL?
Author neighbour.kerry
--- In firebird-support@yahoogroups.com, "Maya Opperman" <maya@...> wrote:
>
> Ouch. I just use an IBSQL (or an FIBSQL now) to call
>
> Alter table xyz add NewField TheType;
>
> I then ignore any errors RE the field already existing.

Yes - I tried doing that, but got endless errors. Since I show all the errors to the customer, this was not a good thing! Perhaps I can choose more carefully which errors to ignore...might be the way to go.


This takes into account new fields - the biggest issue, I guess. Do you ever try to ALTER existing fields? I have found it is rather impractical. Virtually impossible, perhaps.


> Before making any changes though, I drop all stored procedures, and put them all back at the end with one big script generated by IBExtract.

Do you put back THEIR generators/procedures - or do you generate the script with the update program? I have found that perhaps one needs to be careful here - if you are using autoinc fields, the values will get all stuffed up.