Gossamer Forum
Home : Products : DBMan SQL : Discussion :

more information about supported relations

Quote Reply
more information about supported relations
I haven't been able to find information about the following issues, and would welcome pointers in the right direction.

- How does Dbman SQL actually store information about relations?
- What types of relations are supported?
- Is there currently a way to code relations between three tables? E.g. between the entries "John", "owner", "car" in the tables "Persons", "Functions", "Objects". The example might be stupid, but I need this for linguistic relationships, e.g. "text-passage X is an explanation of text-passage Y". Or is there a simpler way of implementing such relationships in relational databases? I'm currently doing this by adding an extra table with, in addition to the primary key, three keys, i.e. the primary keys of each of the three tables.


Thanks a lot in advance,
kellner
Quote Reply
Re: [kellner] more information about supported relations In reply to
My view is this would work in dbman-sql up to a point.

You can set up relationships as follows - (dbman sql only supports one to many relationships between two tables)

So you could set up one to many relationships as follows (where car-func-obj is your fourth table):

person -> car-func-obj
function -> car-func-obj
object -> car-func-obj

Once you've done that, you should be able to get dbman sql to generate add / modify / delete screens for the car-func-obj table. The add form could have 3 dropdowns on it, one for each foreign key.

You should also be able to set up queries to display the information in your 4 tables. Queries work pretty well, but it isn't easy to modify the layout / look of the search results.

Are all combinations of person / function / object valid? If not you may run into problems - see my recent post on 2 select fields.

In general I would say from my limited experience of dbman sql that it will probably do what you want. However if it is important to you how your screens look and exactly what information is displayed on them, you will have quite a lot of work to do modifying page templates, and may need to get into hacking the code a bit to get it to do what you want. There's quite a steep learning curve here (unless you are fluent in object perl) and the manuals currently available are inadequate. You will get some helpful replies here.

Do others agree?


(Information about relationships is stored in the files in the /admin/defs directory. I'm not sure if it's also stored elsewhere)
Tim Ault
Oxford UK

Last edited by:

timbo: Nov 20, 2003, 2:53 AM
Quote Reply
Re: [timbo] more information about supported relations In reply to
Thanks for the reply; I'll give it a try with your suggestions.

The storage of relations is really important for me, as I work with tables that are also used in another application, which is why I am not allowed to make any changes to existing tables at all, especially as far as primary or foreign keys are concerned. It's therefore good news to me that dbman only stores this in /admin/defs, but perhaps someone could confirm that it doesn't also change the database definition in MySQL (or Oracle, which I'm actually using)?
kellner
Quote Reply
Re: [kellner] more information about supported relations In reply to
The relation info will be stored in def files and dbman SQL will not change table structure when you create relationship between tables.

Hope that helps,
TheStone.

B.
Quote Reply
Re: [TheStone] more information about supported relations In reply to
Thank you!
kellner