Use SHOW COLUMNS on the table first; check if the desired column name is in there, or ALTER TABLE as necessary. I think there is a MySQL-specific command you can probably use; IF NOT .. clause, but that's bad practise. It's probably better to use SHOW COLUMNS, since it will allow you to easily adopt different RDBMS's. Really makes DBI's strengths shine. :)
On 5/12/05, Ing. Branislav Gerzo <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm making script, and I'd like add column, if column not exist. My DBS is > MySQL, and I didn't find direct SQL command for this. Is there some > workaround for this ? > > thanks. > > -- Regards, Rachel Llorenna (frequency)