Re: Simple Database Design Problem
Posted by: Filip Nedyalkov
Date: June 11, 2011 04:56PM

Ok thanks for the advices on that matter.

I would like to ask one more thing.

From table templates, each template can have many components (table components). It's like one to many relation - not a problem here.

But here is my wondering:
Things work like this. First the user installs components, so each component goes in the components table under component_id: 1,2 etc.

After the user has finished installing the components, they go to install the templates that use that components. So the questions I have here are:
1) When you insert the template data how will it recognize which are the component_ids that belong to it? (have in mind that the user builds the template with that components, so he knows which components the template includes, the problem is how to identify them when installing the template?)

Solution: here as a solution I thought that setting an unique identifier for each component like component_name for example would be enough for the template to get the id of the component that belongs to it. Does that sound good?

2) When you insert some data in a row in a table, can you get the id of that row you just inserted? If I am able to do that then I could write a script that installs the components and gets their ids and then installs the template and sets the components ids it uses. Of course a flaw in this approach is that I could do that only with the first install. If I already have the components installed and just want to install the template I won't know their ids... so I guess that's not good.

In summary:
I would like not to make the user go and install first the components and then manually trying to identify them and add them to the template when he installs it. But more like a script that first installs the components (rows in a table) and then installs the templates that can auto identify which components from the component table belong to it and write down that component ids for it. Presumably here I suggested that I would pass the unique components names when searching the components table and add their ids to the template in question.

So thoughts ?

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.