469,643 Members | 1,220 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,643 developers. It's quick & easy.

Check if field already exist

How can I check if a field already exist in a table? If it doesn't exist I want
to add it with ALTER TABLE ADD...
Jul 19 '05 #1
3 3250
SR
On 2 Feb 2004 04:53:49 -0800, Roger wrote:
How can I check if a field already exist in a table? If it doesn't exist I want
to add it with ALTER TABLE ADD...


Check the output of:

explain <table_name>;

and see if the string returned contains the field name; if not fire up the
alter table statement.
Jul 19 '05 #2
SR
On 2 Feb 2004 04:53:49 -0800, Roger wrote:
How can I check if a field already exist in a table? If it doesn't exist I want
to add it with ALTER TABLE ADD...


Check the output of:

explain <table_name>;

and see if the string returned contains the field name; if not fire up the
alter table statement.
Jul 19 '05 #3
SR
On 2 Feb 2004 04:53:49 -0800, Roger wrote:
How can I check if a field already exist in a table? If it doesn't exist I want
to add it with ALTER TABLE ADD...


Check the output of:

explain <table_name>;

and see if the string returned contains the field name; if not fire up the
alter table statement.
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Adam Lipscombe | last post: by
2 posts views Thread by kaming | last post: by
4 posts views Thread by Nick Sinclair | last post: by
2 posts views Thread by Yoshitha | last post: by
1 post views Thread by Agnes | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.