People That Know SQL, Care to Lend a Hand?

Kinja'd!!! "Dwhite - Powered by Caffeine, Daft Punk, and Corgis" (Dwhite95)
12/14/2015 at 15:56 • Filed to: None

Kinja'd!!!0 Kinja'd!!! 4

Boring stuff after the jump, have some Alfa’s

Kinja'd!!!

For our final project we need to build and populate a database in Oracle. When we try populate a few tables we are getting some errors. .

So with this statement here:

INSERT INTO PlaysIn VALUES (‘000000001’,’Arizona Cardinals’,’Baltimore Ravens’, TO_DATE(‘10/10/15’, ‘MM/DD/YY’);

I get an error of “ORA-00917: missing comma”

Table details here:

CREATE TABLE PlaysIn (

playerID number(9),
team1 varchar2(30),
team2 varchar2(30),
pDate date,
CONSTRAINT PlaysIn_pk PRIMARY KEY (playerID, team1, team2, pDate),
CONSTRAINT PlaysIn_fk1 FOREIGN KEY (playerID) REFERENCES Player(playerID),
CONSTRAINT PlaysIn_fk2 FOREIGN KEY (team1, team2, pDate) REFERENCES Game(team1, team2, pDate));

Any ideas?


DISCUSSION (4)


Kinja'd!!! crowmolly > Dwhite - Powered by Caffeine, Daft Punk, and Corgis
12/14/2015 at 16:01

Kinja'd!!!2

INSERT INTO PlaysIn VALUES (‘000000001’,’Arizona Cardinals’,’Baltimore Ravens’, TO_DATE(‘10/10/15’, ‘MM/DD/YY’) ) ;

Looks like you may be missing a closing parentheses?


Kinja'd!!! Dwhite - Powered by Caffeine, Daft Punk, and Corgis > crowmolly
12/14/2015 at 16:09

Kinja'd!!!0

Nice catch, I’m gonna go look at that.


Kinja'd!!! Eric @ opposite-lock.com > Dwhite - Powered by Caffeine, Daft Punk, and Corgis
12/14/2015 at 16:11

Kinja'd!!!0

Beyond what crowm... mentioned, if you're copy-pasting that, the single quotes are a Unicode mess.


Kinja'd!!! davesaddiction @ opposite-lock.com > crowmolly
12/14/2015 at 16:36

Kinja'd!!!0

That’s what I saw first, too.