Subject Re: [firebird-support] Bug in create table?
Author Helen Borrie
At 11:02 PM 11/03/2009, you wrote:
>Hi,
>
>Days ago I was creating a table names "Clientes" using Firebird SQL Maestro to manage my database using CREATE TABLE and some ALTER TABLE to create the indexes.
>
>The script generates an error in metadata update (i do not remember the exact error) but after some retries, i selected only the create table part and executed the script. It succeeded and I continue working.

Scripts are just batches of statements. If you are using a third-party tool that has a scripting interface, make sure you are able to control what happens to later statements if exceptions occur in earlier ones. A bad line in a script doesn't stop the script from continuing to execute! The Firebird engine itself doesn't know it is executing a script. ;-)

>Later I wanted to change a field named "Observaciones" from a blob text to a large varchar and ALTER TABLE command rejected to make the change (also to drop de column) showing a -607 error in metadata update.
>
>Seeing the definition in my original script I noticed that I have put TWO columns named "Observaciones" !!!
>
>The table was created with only one column but RDB$RELATION_FIELDS had 2 rows, one for each Observaciones field.
>
>So I believe it must be a bug in firebird's code.

I can't make that happen. ;-) If you still have the database with this apparent bug, check its definition using isql SHOW TABLE. It *will* be possible to create 2 fields in the same table, one defined as "Observaciones" (with the double quotes) and one as Observaciones (without the double quotes). In the second case, the engine will store OBSERVACIONES. Some third-party tools do strange things with double-quotes in definitions, either adding them when they are not wanted, or stripping them.

As to your other problems, you can't perform ALTER TABLE on a table whose definition is uncommitted. That's not a bug: it is *by design*.

Also, you cannot change a blob to any other data type.

./heLen