Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Best way to implement m to n relation?

GeertDePaepNov 15 2011 — edited Nov 16 2011
Could you please give me some advice on the best way to implement m-n relations in apex?

Example: I want to store server and database info. A server can have multiple database of course. But in case of a RAC database, the database can be running on multiple servers. So I have tables:

create table SERVERS (id number primary key, name varchar2(30));
create table DATABASES(id number primary key, name varchar2(30))
and an m-to-n table
create table SERV_DB(serv_id number references SERVERS(id), db_id number references DATABASES(id), instance_name varchar2(30))

So the table SERV_DB can tell me e.g. that database PROD is running on server 'prdsrv1' with instance PROD1 and on server 'prdsrv2' with instance name PROD2

How would you design an apex page to maintain this information (adding relations, updating instance names, etc)? I have a solution using checkboxes and 2 for-loops over htmldb_application.g_f40 (to process checkboxes) and g_f41 (to process text fields with instance names) and some delete statements but the logic behind it looks too complex for me. I am convinced that this can be done more simpler. Seems like a common problem to me, so I wonder if there is no out-of-the-box solution in apex for this?

Could you please show me or create a small demo application with the solution that looks most elegant to you?

Thanks,
Geert
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 14 2011
Added on Nov 15 2011
3 comments
614 views