[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUe] Master/Detail queries
From: |
Stefan Elwesthal |
Subject: |
[GNUe] Master/Detail queries |
Date: |
Tue, 22 Mar 2005 14:48:08 +0800 |
Hello all!
Spent my night trying to work through all this new knowledge that I received
yesterday playing with GNUe.
One thing bothers me, but this might be my lack of knowledge in the database
field, I aplogize if that's the case.
(I've only gotten to page 62 in the "MySQL Bible" yet)
If I create two tables like this:
CREATE TABLE customer
(
customer_id INT NOT NULL,
name VARCHAR(30),
PRIMARY KEY (customer_id)
) TYPE = INNODB;
CREATE TABLE customer_sales
(
transaction_id INT NOT NULL,
amount INT,
customer_id INT NOT NULL,
PRIMARY KEY(transaction_id),
INDEX (customer_id),
FOREIGN KEY (customer_id) REFERENCES customer (customer_id)
) TYPE = INNODB;
And link them together like this:
<datasource name="dtsCUSTOMER0" connection="innodbtest" requery="True"
table="customer"/>
<datasource name="dtsCUSTOMER_SALES1" connection="innodbtest"
detaillink="customer_id" master="dtsCUSTOMER0"
masterlink="customer_id" requery="True"
table="customer_sales"/>
I can only perform queries on customer_id's, otherwise I get such a HUGE Error
message that I could spend half a day reading through it. Now, in an Ordertable
one would like to select the Ordernumber, and then bring up the customer_id
(which would be the reference to link together the tables).
It's too early, maybe I'm jabbering, and the more I think about it, this seem
to be a question about database design, I suppose a GNUe-form could have
several master/detail relations?
Regards
Stefan - the one who really would prefer to be at home not in his office today..
--
______________________________________________
Check out the latest SMS services @ http://www.linuxmail.org
This allows you to send and receive SMS through your mailbox.
Powered by Outblaze
- [GNUe] Master/Detail queries,
Stefan Elwesthal <=