In Oracle Apex, I have some related tables i.e:
**Person Table**
Id
Name
**Person_Contact Table**
Id
PersonFK
Tel
Address
**Person_Account Table**
Id
PersonFK
BankName
AccountNumber
these are 1-to-1 tables and PersonFK is the Foreign Key.
Now, I want to create a wizard with 3 steps.
how can I do this?
should I define 3 tables with 1-to-1 relation (like above) or create just one big table?
and
what is the best practice in Oracle Apex (in wizard steps forms) for this purpose?
If you are sure that all three tables will remain have common attributes then the option of single table is fine. More detail can be find
here
Related
It's telling me to provide a FK and a table reference when there is no FK in the table, nor a relevant table to reference.
You do not need to define a FK. Just scroll down and click Next.
Can someone suggest a way to generate delete queries for various tables linked via foreign key constrains for Oracle ? A solution for SQLServer is mentioned here
Copied description from the original question :
I have the table: DelMe(ID) and there are 30 tables with fk references
to its ID that I need to delete first, is there some tool/script that
I can run that will generate the 30 delete statements based on the FK
relations for me ?
I'm looking through our data and there's a handful of tables in our oracle database that show up with two one to many relationships: http://i.stack.imgur.com/icGcV.png
I'm not sure why this would be happening, and is it something I should look into getting changed or fixed?
(I did not create this database, I am only trying to understand it!)
Too long for a comment, let's see a very simple example:
CREATE TABLE persons
(
id NUMBER PRIMARY KEY,
name VARCHAR2(10)
)
/
CREATE TABLE marriages
(
wife NUMBER REFERENCES persons(id),
husband NUMBER REFERENCES persons(id)
)
/
CREATE TABLE dogs
(
id NUMBER PRIMARY KEY,
name VARCHAR2(10),
owner NUMBER REFERENCES persons(id)
)
/
Here you have one table with two different FKs to the same table. At the same time you have another table with a single FK to the same table.
So, it's not a problem to fix, but a part of DB design to understand;
your DB can be well or bad designed, but the existence of such situations does not say anything about that.
I need to create a sequence whose value is going to be read by call to .NEXTVAL in PL/SQL code and saved in more then one record of a specific table column, so my design doesn't require to define a PK on the aforementioned column.
I cannot find out how to edit the sequence tab in Oracle Data Modeler (I'm on version 4.1.1) when the PK checkbox is not selected (all the sequence related fields are disabled).
Any idea?
In the relational model, choose your DB and within that you will find sequence as an item to create. You can also create other types of object here.
In a database I have the tables User, Group and UsersInGroup and generate the entities from the database using the Symfony 2 console. The table UsersInGroup is not generated as an entity but is partly generated into User and Group. This would be perfect if UsersInGroup hat only two columns userId and groupId (together primarykey), in this case the table UsersInGroup also contains a third column Role. This field is can never be filled using the generated entities
How should I fill the Role column in the tabel UsersInGroup?
You have to declare your relation table manually and to map the relations.
You'll find an interesting discussion here:
Doctrine2: Best way to handle many-to-many with extra columns in reference table