create-table


SQL Error: ORA-00904: : invalid identifier in creating table


SQL Error: ORA-00904
MY CODE IS:
CREATE TABLE VINTAGEWINE
(
WINE_ID VARCHAR2(5) NOT NULL,
WINE_NAME VARCHAR2(25) NOT NULL
VINTAGE_YEAR VARCHAR2(4) NOT NULL,
EMPLOYEE_ID VARCHAR2(6) NOT NULL,
CONSTRAINT PK_VINTAGEWINE PRIMARY KEY(WINE_ID),
CONSTRAINT FK1-VINTAGEWINE FOREIGN KEY(WINE_NAME) REFERENCES WINE(WINE_NAME),
);
Error:
Error at Command Line:8 Column:14
Error report:
SQL Error: ORA-00904: : invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
I don't know what's wrong with my code. Did I do something dumb?
Either CONSTRAINT FK1-VINTAGEWINE is illegal, or the FK1-VINTAGEWINE must be quoted, I think. Use an underscore instead of a hyphen.
CREATE TABLE VINTAGEWINE
(
WINE_ID VARCHAR2(5) NOT NULL,
WINE_NAME VARCHAR2(25) NOT NULL
VINTAGE_YEAR VARCHAR2(4) NOT NULL,
EMPLOYEE_ID VARCHAR2(6) NOT NULL,
CONSTRAINT PK_VINTAGEWINE PRIMARY KEY(WINE_ID),
CONSTRAINT FK1-VINTAGEWINE FOREIGN KEY(WINE_NAME) REFERENCES WINE(WINE_NAME)
);
Please try this. An unwanted comma was inserted at the end of foreign key constraint definition.

Related Links

Create table with constraint in openedge progress
Create table automatically in database backup when I create table from database source
Create Table in Impala use one Table for the Datatype
i cannot create a table , what is the wrong here ? ( Syntax error: Encountered “(” )
What is the recommended way to create table with PetaPoco (and NPoco)?
SQL oracle Developer error
'create table' event … with Apache Cassandra
Creating table in mysql but the error keeps poping up , what am i doing wrong?
How to create table with Simple.Data?
“table or view does not exist” but it does
SQL Error: ORA-00904: : invalid identifier in creating table

Categories

HOME
hive
openmp
reflection
relative-path
fft
raspberry-pi
tesseract
grep
bpmn
at-command
rubygems
packages
jgroups
icloud
ravendb
mvvmcross
onelogin
uber-api
multiple-records
virtualization
slurm
nano-server
wheelnav.js
dax
mapserver
circuit
tostring
reactcsstransitiongroup
nodatime
abi
chromium-embedded
zurb-foundation-6
jndi
one-to-many
bootstrap-material-design
gitignore
c++-amp
flink-streaming
nouislider
google-cloud-endpoints-v2
commit
rotational-matrices
wixsharp
event-driven
jvm-languages
thin
sas-jmp
apache-fop
yii2-extension
csound
composite-key
abcpdf9
qpid
gstreamer-0.10
lttng
two-factor-authentication
natvis
drawbitmap
sankey-diagram
vstest.console.exe
website-monitoring
gui-test-framework
javafx-webengine
rdtsc
markers
rdl
onactivityresult
eol
funcunit
marmalade
intentservice
gridcontrol
eventlistener
parametric-equations
nsdatecomponents
fireworks
psi
f#-powerpack
radcombobox
castle-monorail
webkit.net
zend-tool
sector

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App