I have made an little database, can someone help me
to give an little cascade update script for mine database..
create table Boektypen (
bkt_BoektypeID integer not null,
bkt_Boektypenaa m varchar(35) not null,
bkt_Jeugdgeschi kt bit,
primary key (bkt_BoektypeID ))
go
create table Boeken (
bkn_Titel varchar(40) not null unique,
bkn_ISBN varchar(12) not null unique,
bkn_TypeID integer not null,
primary key (bkn_ISBN),
foreign key (bkn_TypeID)
references Boektypen)
go
create table Personen (
prs_Lidnummer numeric(10) not null unique,
prs_Naam varchar(40) not null,
prs_Initialen varchar(10) null,
prs_Voorvoegsel varchar(15) null,
prs_Geboortedat um datetime not null,
primary key (prs_Lidnummer) )
go
create table Boetegegevens (
btg_Boetebedrag numeric(3,2) not null,
btg_Maximaleuit leentermijn numeric(3) not null)
go
create table Uitleningen (
utl_Lidnummer numeric(10,0) not null,
utl_ISBN varchar(12)not null,
utl_Uitleendatu m datetime not null,
utl_Terugbezorg datum datetime null,
utl_Boete numeric(3,2),
foreign key (utl_Lidnummer)
references Personen,
foreign key (utl_ISBN)
references Boeken)
go
create table Bibliotheekmede werkers (
bmw_Code char(3) not null,
bmw_Medewerker bit)
0 2968 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Fraser Hanson |
last post by:
Hello,
I have a table which has a foreign key relationship with itself. I
want and expect my updates to cascade (deletes definitely cascade as
expected) but instead I just get error 1217: foriegn key error.
I have written example code to use in reproducing the problem:
# Create the table
|
by: Gunnar Vøyenli |
last post by:
Hi!
For the sake of simplicity, I have three tables, Employee, Department and
Work
Employee >---- Department
\ /
\ /
^ ^
Work
|
by: SuryaPrakash Patel via SQLMonster.com |
last post by:
Hello,
There are three tables:
OS-GroupOFCompanies (Table1)
GoC_GroupOFCompaniesID (PK)
OS-Organization (Table 2)
Org_OrganizationID (PK)
|
by: P.B. via SQLMonster.com |
last post by:
I cannot execute my sql to create a table with ON DELETE CASCADE option.
Here is my sql:
CREATE TABLE Employees (Name Text(10) not null, Age number,
CONSTRAINT pkEmployees
PRIMARY KEY (Name)); <--- This is ok!
CREATE TABLE CanTake (Name Text(10) not null, Make Text(10) not null,
CONSTRAINT pkCanTake
PRIMARY KEY (Name, Make),
|
by: Jack |
last post by:
We are have a question about the no cascade option on before triggers.
The description stays that no other triggers will be fired by the
changes of a before trigger. One of our developers is seeing results
that would imply that other after triggers are being fired by the
results of a before trigger.
Is this possible? Is there some little documented behavior going on
here?
thanks
| |
by: Lee C. |
last post by:
I'm finding this to be extremely difficult to set up. I understand
that Access won't manage the primary key and the cascade updates for a
table. Fine. I tried changing the PK type to number and setting
default value to a UDF that manages the auto-numbering. Access won't
take a UDF as a default value. Okay, I'll use SQL WITHOUT any
aggregate functions, for the default value. Access won't do that
either. Okay, I create a second...
|
by: Karl O. Pinc |
last post by:
Hi,
Thought perhaps some other eyes than mine can tell if I'm doing
something wrong here or if there's a bug somewhere. I've never
passed a ROWTYPE varaible to a function but I don't see where
the problem is.
I keep getting errors like (the first is my debug output):
NOTICE: last cycle is: 11
WARNING: Error occurred while executing PL/pgSQL function
|
by: Allen Browne |
last post by:
In Access 2000 and later, you can create a relation between tables where
related records can be automatically set to Null rather than deleted when
the primary record is deleted.
I have not seen anyone using or discussing this feature, so there is a new
article explaining the concept here:
Cascade to Null Relations
at:
http://allenbrowne.com/ser-64.html
|
by: HH |
last post by:
I try to make a script for generating backend databases. When I try to
make a relationship between a table named 'users' and another table
name 'layouts' an error occurs.
Option 1:
CurrentDB.Execute "ALTER TABLE layouts ADD CONSTRAINT users_layouts
FOREIGN KEY (user_id) REFERENCES users(id) ON UPDATE CASCADE"
Option 2:
DoCmd.RunSQL "ALTER TABLE layouts ADD CONSTRAINT users_layouts FOREIGN
|
by: akdemirc |
last post by:
Hi,
i have tree tables in my db, one for menu, one for menu items and the other authorization.. They have the following columns and relationships:
Menu
-----------------
id (PK), name, position
MenuItem
---------------
id (PK), name, parent (FK to Menu->id), position
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |