Link to home
Start Free TrialLog in
Avatar of vikramrathour
vikramrathour

asked on

Detecting a cartesian product

I am developing a query builder form something similar to TOAD.
When the user selects multiple columns from various tables i need to detect whether the tables can be joined or not. I want this to be done so that i can avoid a cartesian product when the final query is built and run on the server.
Is there a way to detect if two tables would cause a cartesian product / not.
Avatar of Lowfatspread
Lowfatspread
Flag of United Kingdom of Great Britain and Northern Ireland image

which database system?

how are you expecting the joins to be specified anyway?

Avatar of vikramrathour
vikramrathour

ASKER

I am using Oracle Database.
The joins will either be specified by the user or i would be picking up the primary keys of both tables and try and equate them.
Thats what i am thinking of right now but can some one tell me a better solution.
ASKER CERTIFIED SOLUTION
Avatar of Lowfatspread
Lowfatspread
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial