• 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Hypersonic DB question

 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trying to follow a tutorial here

Tutorial

Running this script in order to create tables:



However, the ITEM table is not created. It keeps telling me that



What is the meaning of this error? What do I need to change to make it work???

Thanks, I am quite new to this.
 
Bartender
Posts: 2653
18
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to provide a unique name for your constraint.

You name your constraint SYS_FK_SUPPLIER for table SUPPLIER,
and you also try to create a constraint with the same name for table ITEM.

Try someting like ... CONSTRAINT <TABLENAME>_FK_SUPPLIER.

Regards, Jan
 
Joseph Sweet
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. What does CONSTRAINT mean?

I could not find anything about it on Google.
 
Jan Cumps
Bartender
Posts: 2653
18
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A constraint is a validation mechanism.
It will guard that the data that you write adheres to your rules.

Your constraint CONSTRAINT SYS_STOREACCESS_UQ UNIQUE(USERNAME) will allow only unique values in column USERNAME.
If your table STOREACCESS has a record with USERNAME == 'Joseph Sweet', and you try to insert a new record with USERNAME == 'Joseph Sweet', it will fail.
Also updating another record to set USERNAME == 'Joseph Sweet' will fail.

Your constraint guarantees that USERNAME will only have unique values. No duplicates are allowed.

Regards, Jan
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!