Subject RE: [ib-support] Re: Add a column after a specific field on exist ing tables
Author Wilson, Fred
Just curious why the big concern about the column position ??
It's never been a problem for us. Why's it a problem for anyone ??



Best regards,
Fred Wilson
SE, Bell & Howell
fred.wilson@...


-----Original Message-----
From: Kevin Morris [mailto:kmorris5319@...]
Sent: Wednesday, November 06, 2002 12:57 PM
To: ib-support@yahoogroups.com
Subject: [ib-support] Re: Add a column after a specific field on
existing tables


Paul & Hans,

Thanks for your quick response! For those who are interested the
final solution I devised for mapping MySQL's:

ALTER TABLE <table_name> ADD <new_column> <datatype> AFTER
<existing_column>

syntax to firebird SQL is

1. ALTER TABLE <table> ADD <new_column_name> <datatype>

2. SELECT rdb$field_position POS FROM rdb$relation_fields WHERE
rdb$relation_name='<table>' and rdb$field_name='<existing_column'

3. ALTER TABLE <table> ALTER <new_column> POSITION (<POS num from
above>+1)

So far my MySQL to Firebird conversion is going quite well. My only
peeve is the time to create a connection through JDBC with firebird
(about a second), versus MySQL (~0.1 seconds). With connection
pooling, however it's not a big deal.

Other than that, FB's robust feature set, (e.g., transactions, sub
selects, UDFs) makes it much superior.

Thanks all!

Kevin Morris

--- In ib-support@y..., Paul Vinkenoog <paul@v...> wrote:
> Hi Kevin,
>
> > Is there a way to specify the column position for a new column
> > added to an existing table.
>
> AFAIK, there is no way to specify the position when you add the
column
> (I wonder why), but this always works:
>
> ALTER TABLE <table> ADD <column> <datatype>
>
> followed by
>
> ALTER TABLE <table> ALTER <column> POSITION <1-based no.>
>
>
> Greetings,
> Paul Vinkenoog


To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



[Non-text portions of this message have been removed]