Wayne Niddery [TeamB] Guest
|
Posted: Thu Apr 22, 2004 10:18 pm Post subject: Re: delphi mysql If not exist column |
|
|
Eric wrote:
| Quote: | Hi I'm usign Delphi6 with MySQL ODBC.. I want to update a table if the
column doesn't exist.. So I need to validate if the column exist and
if not create it...
I can do this/..
ALTER TABLE INVOICING
ADD COLUMN USERINT INT
|
You could query the system tables, however it's probably just as easy to
just execute your Alter statement above - if the column already exists, the
statement will simply return you an exception, it won't cause any problem in
the database.
--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
RADBooks: http://www.logicfundamentals.com/RADBooks.html
"True peace is not the absence of tension, but the presence of
justice." - Martin Luther King, Jr.
|
|