473,473 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

problem with 2 not null fileds on one table

9 New Member
Hi everyone,

i ahve the one table with 2 not null fileds ,in this one column accept certain values (1,2,3), and another column will accept (1m,2m,3m).

the problem is when the data extracting from differnt sources we have 2 types of sources.
if suppose first source is extracting data into table the y will populate their repective filed ,they will not populate another filed. in that time not null constraint voilation is coming..

can u provide aany solution for this....friends..
Nov 17 '06 #1
3 2093
pragatiswain
96 Recognized Expert New Member
While inserting, in anycase you are providing NULL value for the NOT NULL column, this error occurs. Alter the table to set default value for the column.

ALTER TABLE <TABLE-NAME> MODIFY <COLUMN-NAME> DEFAULT <DEFAULT-VALUE>

example : ALTER TABLE TABLE_X MODIFY COLUMN_Y DEFAULT '1m'

Hope this helps
Nov 17 '06 #2
suresh Chowdary
9 New Member
[quote=pragatiswain]While inserting, in anycase you are providing NULL value for the NOT NULL column, this error occurs. Alter the table to set default value for the column.

ALTER TABLE <TABLE-NAME> MODIFY <COLUMN-NAME> DEFAULT <DEFAULT-VALUE>

example : ALTER TABLE TABLE_X MODIFY COLUMN_Y DEFAULT '1m'

Hope this helps[/QUOT


Thanks for ur help. friend
Nov 22 '06 #3
pragatiswain
96 Recognized Expert New Member
You set default value for both the columns of the same table.

ALTER TABLE TABLE_X MODIFY COLUMN_Y DEFAULT '1m'
ALTER TABLE TABLE_X MODIFY COLUMN_Z DEFAULT 1
Nov 22 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: tym | last post by:
HELP!!! I'm going round the twist with this... I have a VB6 application which is using DAO to access a database (Please - no lectures on ADO, I know what I'm doing with DAO!!) Ok, problem...
1
by: allyn44 | last post by:
Hello--i have inherited a dataset that has records like below: id locationid 1 7 2 3 5 4 5 6 4
2
by: DataB | last post by:
Hi everyone! I have a forms problem. Bakground: I have created a number of tables. Of these, I have a main parent table (Personal Details) and a number of other child tables (Tax file No.,...
4
by: Reney | last post by:
I have a very weird problem in updating my datagrid. Please help me to solve it. The datagrid is tied to a dataset table with five columns. Three of them are primary key and the other two columns...
4
by: Igor | last post by:
I have one SELECT statement that needs to return one ntext field from one table and count something from other table, problem is that all fileds that are not in count have to be in group by and...
3
by: shark | last post by:
Hi all. i am facing a deadlock problem .i have included the -t1204 and -T3605 trace flags and have got the following o/p pu tin sqls server logs. 2006-06-01 17:49:21.84 spid4 2006-06-01...
2
by: mukeshhtrivedi | last post by:
I have Cost Analysis form created where there are three fileds and I want to have total of all the fileds at the end. I have created text box which has Control Source as =++. It shows me total of...
5
by: Tradeorganizer | last post by:
Hi, I have a database with table name as test in that i have 6 colums they are name varchar (20) address varchar (20) position varchar (20) nametype1 varchar (20) nametype2 varchar (20)
4
by: neelesh kumar | last post by:
sir, in my form textboxes named qst,opt1,opt2,opt3,opt4 are there having control sources(question,option1,option2,option3,option4 which are memo fields) from the tblexam. if isnull(qst.value)...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.