473,395 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 3417
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: | last post by:
If I need to check if a certain value does exist in a field, and return either "yes" or "not" which query would be the most effestive?
12
by: Adam Lipscombe | last post by:
Folks, I need to get the contents of a form attribute. In Read/Write mode this is field, so I can use getElementById("name").value In ReadOnly this is just plain text, so I can use...
2
by: kaming | last post by:
Dear all, Is it possible to define a check constraint on a field that the field value must exist in another table non-unique field? how to write the create table DDL? i.e TABLE A TYPE,...
13
by: MLH | last post by:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If LaborCost > 0 Then Me!LaborCost.Visible = True If MatlsCost > 0 Then Me!MatlsCost.Visible = True If OtherCost > 0 Then...
4
by: Nick Sinclair | last post by:
Hi all, I'm new to C. I have successfully written a small C program that acts as a "wrapper" around cgi scripts. These scripts perform admin tasks such as backing up etc. Obviously, The need...
2
by: Yoshitha | last post by:
In my webform i have 2 textbox controls and one button control. in 1st textbox control i'll enter email id when it lost its focus i've tocheck whether the entered email id exist in...
2
by: RLN | last post by:
Re: Access 2003 I have code to check to see if a table exists. There are several other tables (tblQ12, tblQ13, etc) that do already exist & this code runs fine; msgbox says the value returned is...
3
by: byeung | last post by:
Hi, I am trying to check if a particular record already exists in an Access database through Excel vba code. Through code obtained at another forum, I got the following: ...
1
by: Agnes | last post by:
pKcno = myReader.Item("kcno") <--it will return error when the field "kcno" doesn't exist any method to check the field exist or not first , if not exist, I want to skip the above statement. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.