Re: alter table add column question



Keith G Hicks wrote:
> Is there a way to specify what position a column is in the table when
> altering tables in code? I have a client that has me do major updates
> annually which involve removing obsolete columns and adding new columns. I
> set up code in batches and thoroughly test things before altering their
> production data. So I might have a prg file that does soemthign like this
> (dumb example but you'll get the idea):
>
> alter table Customer drop column KidsNames
> alter table Customer add column DogsNames c(50)
>
> Let's say there are 12 columns in the table and I'd like DogsNames to occupy
> the 6th position. I know of course that I can do "modi stru" and move it
> manullly but that defeats the purpose of writing my code. How can I position
> columns so that they are not just tacked onto the end of the table?
>
> Thanks,
>
> Keith
>
>

Just curious as to why you would want this?
Are you writing code that relies on column positions?

.



Relevant Pages

  • Re: alter table add column question
    ... > set up code in batches and thoroughly test things before altering their ... > alter table Customer drop column KidsNames ... > alter table Customer add column DogsNames c ...
    (microsoft.public.fox.programmer.exchange)
  • Re: what is the output of this program?
    ... Keith, have I read too much into your comment? ... rightly draws a distinction between code that exhibits undefined behaviour ... Writing code of the first kind is very sensible, ...
    (comp.lang.c)
  • alter table add column question
    ... set up code in batches and thoroughly test things before altering their ... alter table Customer drop column KidsNames ... alter table Customer add column DogsNames c ...
    (microsoft.public.fox.programmer.exchange)
  • Improving Python (was: Lambda going out of fashion)
    ... Keith> or 2.4 is very good, has more features than most people will ever ... Keith> use, and they (Guido, et al.) can stop tinkering with it now and ... Note that there's more to be done than simply writing code. ...
    (comp.lang.python)