|
|
|
#1 (permalink) | ||||||||||||
|
WaterCooler
|
Can any one tell me why SQL is saying invalid column name. . . I'm simply trying to add a NOT NULL CONSTRAINT
![]()
__________________
XPS M1330: T7500, 4GB, 13.3" LED WXGA, 128 8400 GS, 120GB 5400RPM, 802.11 AGN, 9 cell, Fingerprint, Ultimate x64, 4 Year Accidental Damage/lojack/warranty. __________________
|
||||||||||||
|
|
|
|
#2 (permalink) | ||||||||||||
|
WaterCooler
|
illegal bump because if this is wrong then I have to change many other lines of code before moving on to indexes, sequences, etc. . . and its due tomorrow. . I have it written out but not compiled. . ..
__________________
XPS M1330: T7500, 4GB, 13.3" LED WXGA, 128 8400 GS, 120GB 5400RPM, 802.11 AGN, 9 cell, Fingerprint, Ultimate x64, 4 Year Accidental Damage/lojack/warranty. __________________
|
||||||||||||
|
|
|
|
#3 (permalink) | ||||||||||||
|
Programmer
|
I don't know anything about constraints, but your sql query looks a little strange. Something like this?
__________________Code:
ALTER TABLE Parents 2 ADD CONSTRAINT First_Guard_Last_nn NOT NULL (First_Guard_Last), ADD CONSTRAINT First_Guard_Last_nn NOT NULL (First_Guard_Last); Edit: Actually I'm not quite sure even that would be right, syntax-wise. ![]()
|
||||||||||||
|
|
|
|
|
#4 (permalink) | ||||||||||||
|
WaterCooler
|
The second one is added when there is an error. . it repeats the erroneous code.
__________________
XPS M1330: T7500, 4GB, 13.3" LED WXGA, 128 8400 GS, 120GB 5400RPM, 802.11 AGN, 9 cell, Fingerprint, Ultimate x64, 4 Year Accidental Damage/lojack/warranty. __________________
|
||||||||||||
|
|
|
|
#5 (permalink) | |||||||||||||
|
Bifford
![]() |
I *think* you can do:
ALTER TABLE Parents ADD CONSTRAINT First_Guard_Last_nn SET NOT NULL I don't think you need the parens because you aren't doing a multiple column constraint.
__________________
Helpful Posts (Hopefully )Overclocker's Calculator Photo Editing - B&W w/Color Accents
|
|||||||||||||
|
|
|
|
#6 (permalink) | ||||||||||||
|
WaterCooler
|
Ill try as soon as I can reconnect to the Terminal . .
and since I cant rep a mod Ill give you one of these: ![]()
__________________
XPS M1330: T7500, 4GB, 13.3" LED WXGA, 128 8400 GS, 120GB 5400RPM, 802.11 AGN, 9 cell, Fingerprint, Ultimate x64, 4 Year Accidental Damage/lojack/warranty. __________________
Last edited by DanNEBTD : 07-05-07 at 12:30 AM. |
||||||||||||
|
|
|
|
#7 (permalink) | ||||||||||||
|
Database Developer
|
Are you using mySQL? I'm only familiar with MS SQL Server so take what I say with a grain of salt.
__________________Try using square brackets around your column name like this: [First_Guard_Last] - or fully qualify it like this [Parents].[First_Guard_Last] Also, since I'm not familiar with mySQL, I did some googling for you and came across this (see the synatx under section 3.1) - http://sql-info.de/en/mysql/referential-integrity.html and this: http://dev.mysql.com/doc/refman/5.0/en/alter-table.html Are you sure your synatx is right? From what I read in the 2nd link, it seems to me that your syntax should be: ALTER TABLE parents MODIFY First_Guard_Last varchar2(15) not null Toward the end of that 2nd link, there are a bunch of forum posts. One says: Quote:
|
||||||||||||
|
|
|
|
|
#8 (permalink) | ||||||||||||
|
WaterCooler
|
I modeled my syntax right from my book . . and Im using SQLPlus and have to so I cant use another compiler. . . thanks for the links Ill take a look at them.
__________________
XPS M1330: T7500, 4GB, 13.3" LED WXGA, 128 8400 GS, 120GB 5400RPM, 802.11 AGN, 9 cell, Fingerprint, Ultimate x64, 4 Year Accidental Damage/lojack/warranty. __________________
Last edited by DanNEBTD : 07-05-07 at 12:33 AM. Reason: kinks != links |
||||||||||||
|
|
|
|
#9 (permalink) | ||||||||||||
|
Database Developer
|
Ok, I assumed incorrectly that the output was from mySQL (the mySQL editor looks a lot like SQLPlus).
__________________From this link: http://www.princeton.edu/~storacle/s...tutorial.shtml Quote:
Hope that is more helpful. ![]()
|
||||||||||||
|
|
|
|
|
#10 (permalink) | ||||||||||||
|
WaterCooler
|
damn . . ive never seen that format before. . . hmm . . of course remote desktop doesnt work well over wireless too :-/ . . Ill check tomorrow I guess
__________________
XPS M1330: T7500, 4GB, 13.3" LED WXGA, 128 8400 GS, 120GB 5400RPM, 802.11 AGN, 9 cell, Fingerprint, Ultimate x64, 4 Year Accidental Damage/lojack/warranty. __________________
|
||||||||||||
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|