This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Transfer Learning for Natural Language Processing (MEAP) and have Paul Azunre on-line!
See this thread for details.
Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Oracle Error on Database Creation

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm creating a table that's supposed to hold books.  The foreign key is the authorId and I want it to cascade on delete.  I'm using Oracle 11g.  Whenever I run this I get an error saying: ORA-00905: missing keyword

The tutorials I'm using say the syntax is correct.  This is where I've gone thus far:
http://www.dba-oracle.com/t_constraint_foreign_key.htm
https://www.oracletutorial.com/oracle-basics/oracle-foreign-key/
https://dzone.com/articles/how-to-create-a-foreign-key-on-a-table-in-oracle-s
https://www.youtube.com/watch?v=xDti3Y66Naw

Here's the statement I've written:

 
Saloon Keeper
Posts: 11881
253
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it's supposed to be "DOUBLE PRECISION", not double.

Anyway, why are you using floating point types for prices? Can the price of a book be in fractions of cents? Store the price as an integer number of cents.
 
Sheriff
Posts: 7051
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or maybe FLOAT, but I agree with Stephan about using integers for prices.  I have seen costs in fractions of a penny, though.
 
Looky! I'm being abducted by space aliens! Me and this tiny ad!
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic