List:General Discussion« Previous MessageNext Message »
From:Gleb Paharenko Date:September 26 2005 5:21pm
Subject:Re: add a column if not exists
View as plain text  
Hello.

You can parse the output of 'SHOW CREATE TABLE' or 'SHOW COLUMNS'. See:
   http://dev.mysql.com/doc/mysql/en/show-columns.html
   http://dev.mysql.com/doc/mysql/en/show-create-table.html



Claire Lee wrote:
> I want to check if a column exists in a table before I
> do an alter table to add it. How do I do this in
> mysql? Thanks.
> 
> Claire
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   Gleb.Paharenko@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
       <___/   www.mysql.com



Thread
add a column if not existsClaire Lee26 Sep
  • Re: add a column if not existsPeter Brawley26 Sep
    • Re: add a column if not existsPooly26 Sep
  • Re: add a column if not existsGleb Paharenko27 Sep