Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming

Reply
 
LinkBack Thread Tools
Old 07-04-07   #1 (permalink)
WaterCooler
 
DanNEBTD's Avatar
 
amd nvidia

Join Date: Mar 2006
Location: Boca Raton, FL
Posts: 2,336

Rep: 120 DanNEBTD is acknowledged by manyDanNEBTD is acknowledged by many
Unique Rep: 103
Folding Team Rank: 346
Hardware Reviews: 8
Trader Rating: 8
Exclamation SQL Help Please

Can any one tell me why SQL is saying invalid column name. . . I'm simply trying to add a NOT NULL CONSTRAINT

Attached Thumbnails
sql-help-please-sql1.jpg  
__________________
Quote:
Originally Posted by GuardianOdin View Post
Overkill doesn't exist on OCN. It's what we do.
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.
__________________

System: The 1K CFM Machine
CPU
Opty 170 ccb1e 0609fpaw
Motherboard
A8N32-SLI
Memory
2 gigs Gskill PC4000
Graphics Card
EVGA 7950X2
Hard Drive
4x 36gig Raptors raid 0, 1x 200gig storage
Sound Card
XtremeMusic w/Z5500
Power Supply
PC&P Silencer 750 Quad
Case
Mozart Tx
CPU cooling
Stinger V6, quadrad
OS
Vista Home Premium x86
Monitor
32" Syntax Olevia
DanNEBTD is offline I fold for Overclock.net DanNEBTD's Gallery   Reply With Quote
Old 07-04-07   #2 (permalink)
WaterCooler
 
DanNEBTD's Avatar
 
amd nvidia

Join Date: Mar 2006
Location: Boca Raton, FL
Posts: 2,336

Rep: 120 DanNEBTD is acknowledged by manyDanNEBTD is acknowledged by many
Unique Rep: 103
Folding Team Rank: 346
Hardware Reviews: 8
Trader Rating: 8
Default

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. . ..
__________________
Quote:
Originally Posted by GuardianOdin View Post
Overkill doesn't exist on OCN. It's what we do.
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.
__________________

System: The 1K CFM Machine
CPU
Opty 170 ccb1e 0609fpaw
Motherboard
A8N32-SLI
Memory
2 gigs Gskill PC4000
Graphics Card
EVGA 7950X2
Hard Drive
4x 36gig Raptors raid 0, 1x 200gig storage
Sound Card
XtremeMusic w/Z5500
Power Supply
PC&P Silencer 750 Quad
Case
Mozart Tx
CPU cooling
Stinger V6, quadrad
OS
Vista Home Premium x86
Monitor
32" Syntax Olevia
DanNEBTD is offline I fold for Overclock.net DanNEBTD's Gallery   Reply With Quote
Old 07-04-07   #3 (permalink)
Programmer
 
intel nvidia

Join Date: Nov 2006
Posts: 1,495

Rep: 93 version2 is acknowledged by some
Unique Rep: 76
Trader Rating: 3
Default

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);
What's with the "2"?

Edit: Actually I'm not quite sure even that would be right, syntax-wise.
__________________
System: Duo
CPU
Core 2 Duo E6600 B2
Motherboard
Asus P5B Deluxe
Memory
G.SKILL HZ 2x1gb DDR2 800
Graphics Card
EVGA 9600GSO 384mb
Hard Drive
WD 640gb, Maxtor 160gb
Sound Card
Audigy 2 ZS
Power Supply
FSP 450W
Case
Ultra Aluminus
CPU cooling
Freezer Pro 7
GPU cooling
Stock
Monitor
20.1'' SOYO LCD (Wide)
version2 is offline   Reply With Quote
Old 07-04-07   #4 (permalink)
WaterCooler
 
DanNEBTD's Avatar
 
amd nvidia

Join Date: Mar 2006
Location: Boca Raton, FL
Posts: 2,336

Rep: 120 DanNEBTD is acknowledged by manyDanNEBTD is acknowledged by many
Unique Rep: 103
Folding Team Rank: 346
Hardware Reviews: 8
Trader Rating: 8
Default

The second one is added when there is an error. . it repeats the erroneous code.
__________________
Quote:
Originally Posted by GuardianOdin View Post
Overkill doesn't exist on OCN. It's what we do.
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.
__________________

System: The 1K CFM Machine
CPU
Opty 170 ccb1e 0609fpaw
Motherboard
A8N32-SLI
Memory
2 gigs Gskill PC4000
Graphics Card
EVGA 7950X2
Hard Drive
4x 36gig Raptors raid 0, 1x 200gig storage
Sound Card
XtremeMusic w/Z5500
Power Supply
PC&P Silencer 750 Quad
Case
Mozart Tx
CPU cooling
Stinger V6, quadrad
OS
Vista Home Premium x86
Monitor
32" Syntax Olevia
DanNEBTD is offline I fold for Overclock.net DanNEBTD's Gallery   Reply With Quote
Old 07-05-07   #5 (permalink)
Bifford
 
BFRD's Avatar
 
intel nvidia

Join Date: Dec 2004
Location: Carrollton, TX
Posts: 4,336

FAQs Submitted: 8
Folding Team Rank: 27
Hardware Reviews: 2
Trader Rating: 11
Default

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

System: Main Rig
CPU
E6700 Conroe
Motherboard
Abit QuadGT
Memory
2GB G.Skill PC2 8000 (HZ)
Graphics Card
EVGA 8800GTX
Hard Drive
150 GB Raptor X / 300GB Storage
Sound Card
Audigy 2 ZS
Power Supply
PCP&C Silencer 750
Case
Sigma Shark
CPU cooling
Stock (for now)
GPU cooling
Stock
OS
Vista Ultimate
Monitor
Dual Samsung 204b
BFRD is offline I fold for Overclock.net Overclocked Account BFRD's Gallery   Reply With Quote
Old 07-05-07   #6 (permalink)
WaterCooler
 
DanNEBTD's Avatar
 
amd nvidia

Join Date: Mar 2006
Location: Boca Raton, FL
Posts: 2,336

Rep: 120 DanNEBTD is acknowledged by manyDanNEBTD is acknowledged by many
Unique Rep: 103
Folding Team Rank: 346
Hardware Reviews: 8
Trader Rating: 8
Default

Ill try as soon as I can reconnect to the Terminal . .

and since I cant rep a mod Ill give you one of these:
__________________
Quote:
Originally Posted by GuardianOdin View Post
Overkill doesn't exist on OCN. It's what we do.
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.
__________________

System: The 1K CFM Machine
CPU
Opty 170 ccb1e 0609fpaw
Motherboard
A8N32-SLI
Memory
2 gigs Gskill PC4000
Graphics Card
EVGA 7950X2
Hard Drive
4x 36gig Raptors raid 0, 1x 200gig storage
Sound Card
XtremeMusic w/Z5500
Power Supply
PC&P Silencer 750 Quad
Case
Mozart Tx
CPU cooling
Stinger V6, quadrad
OS
Vista Home Premium x86
Monitor
32" Syntax Olevia

Last edited by DanNEBTD : 07-05-07 at 12:30 AM.
DanNEBTD is offline I fold for Overclock.net DanNEBTD's Gallery   Reply With Quote
Old 07-05-07   #7 (permalink)
Database Developer
 
e_dogg's Avatar
 
intel nvidia

Join Date: Feb 2007
Location: Ventura, CA
Posts: 1,404

Rep: 160 e_dogg is acknowledged by manye_dogg is acknowledged by many
Unique Rep: 137
Trader Rating: 10
Default

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:
You can't drop a NOT NULL constraint on a column the way you can a foreign key or an index, or a default. Instead, just use the 'change' or 'modify' syntax and leave off the NOT NULL bit:

alter table table_name modify col_name bigint default null;

Any pre-existing indexes or foreign keys on the column are not affected.
Hope that helps!
__________________
System: New Hotness
CPU
E6420 @ 2.8
Motherboard
Gigabyte GA-P35-DS3L
Memory
4x1gb G.Skill HZ @ 4-4-4-12
Graphics Card
Evga 9800GTS+ 800/1943/1200
Hard Drive
250gb + 750gb Seagate 7200.10 SATA
Power Supply
Rosewill 550w
Case
Coolermaster CM-690
CPU cooling
Zalman 9500AT
OS
Vista Ultimate x64
Monitor
Viewsonic VP171s
e_dogg is offline   Reply With Quote
Old 07-05-07   #8 (permalink)
WaterCooler
 
DanNEBTD's Avatar
 
amd nvidia

Join Date: Mar 2006
Location: Boca Raton, FL
Posts: 2,336

Rep: 120 DanNEBTD is acknowledged by manyDanNEBTD is acknowledged by many
Unique Rep: 103
Folding Team Rank: 346
Hardware Reviews: 8
Trader Rating: 8
Default

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.
__________________
Quote:
Originally Posted by GuardianOdin View Post
Overkill doesn't exist on OCN. It's what we do.
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.
__________________

System: The 1K CFM Machine
CPU
Opty 170 ccb1e 0609fpaw
Motherboard
A8N32-SLI
Memory
2 gigs Gskill PC4000
Graphics Card
EVGA 7950X2
Hard Drive
4x 36gig Raptors raid 0, 1x 200gig storage
Sound Card
XtremeMusic w/Z5500
Power Supply
PC&P Silencer 750 Quad
Case
Mozart Tx
CPU cooling
Stinger V6, quadrad
OS
Vista Home Premium x86
Monitor
32" Syntax Olevia

Last edited by DanNEBTD : 07-05-07 at 12:33 AM. Reason: kinks != links
DanNEBTD is offline I fold for Overclock.net DanNEBTD's Gallery   Reply With Quote
Old 07-05-07   #9 (permalink)
Database Developer
 
e_dogg's Avatar
 
intel nvidia

Join Date: Feb 2007
Location: Ventura, CA
Posts: 1,404

Rep: 160 e_dogg is acknowledged by manye_dogg is acknowledged by many
Unique Rep: 137
Trader Rating: 10
Default

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:
You can specify a new constraint on an existing table via the alter table command. The following example defines a new not null constraint on the table test_table

describe test_table;
alter table test_table modify (
full_name varchar2(64) constraint nn_test_fullname not null);
describe test_table;
Looks like you need the word "modify" in there. And it looks like the table name comes before the constraint name.

Hope that is more helpful.
__________________
System: New Hotness
CPU
E6420 @ 2.8
Motherboard
Gigabyte GA-P35-DS3L
Memory
4x1gb G.Skill HZ @ 4-4-4-12
Graphics Card
Evga 9800GTS+ 800/1943/1200
Hard Drive
250gb + 750gb Seagate 7200.10 SATA
Power Supply
Rosewill 550w
Case
Coolermaster CM-690
CPU cooling
Zalman 9500AT
OS
Vista Ultimate x64
Monitor
Viewsonic VP171s
e_dogg is offline   Reply With Quote
Old 07-05-07   #10 (permalink)
WaterCooler
 
DanNEBTD's Avatar
 
amd nvidia

Join Date: Mar 2006
Location: Boca Raton, FL
Posts: 2,336

Rep: 120 DanNEBTD is acknowledged by manyDanNEBTD is acknowledged by many
Unique Rep: 103
Folding Team Rank: 346
Hardware Reviews: 8
Trader Rating: 8
Default

damn . . ive never seen that format before. . . hmm . . of course remote desktop doesnt work well over wireless too :-/ . . Ill check tomorrow I guess
__________________
Quote:
Originally Posted by GuardianOdin View Post
Overkill doesn't exist on OCN. It's what we do.
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.
__________________

System: The 1K CFM Machine
CPU
Opty 170 ccb1e 0609fpaw
Motherboard
A8N32-SLI
Memory
2 gigs Gskill PC4000
Graphics Card
EVGA 7950X2
Hard Drive
4x 36gig Raptors raid 0, 1x 200gig storage
Sound Card
XtremeMusic w/Z5500
Power Supply
PC&P Silencer 750 Quad
Case
Mozart Tx
CPU cooling
Stinger V6, quadrad
OS
Vista Home Premium x86
Monitor
32" Syntax Olevia
DanNEBTD is offline I fold for Overclock.net DanNEBTD's Gallery   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 02:00 PM.


Overclock.net is a Carbon Neutral Site Creative Commons License Internet Security By ControlScan

Terms of Service / Forum Rules | Privacy Policy | Advertising | Become an Official Vendor
Copyright © 2008 Shogun Interactive Development. Most rights reserved.
Page generated in 0.28881 seconds with 9 queries