Solved

Database Expert - "ENFORCE FROM", "ENFORCE TO", etc.

Posted on 2006-06-13
9
475 Views
Last Modified: 2012-06-21
Could someone explain to me how the different enforce options work and how they affect data between tables?   I'm a little lost on the relationship.
0
Comment
Question by:trs28
  • 3
  • 3
9 Comments
 
LVL 42

Expert Comment

by:frodoman
ID: 16895399
Here's a very generic description, but the implementation of this really depends on the specific database you're working with.

Enforced From:
When you select this option, if the "to" table for the link is used, the link is enforced. For example, if you create a link from Table A to Table B using Enforce From and select only a field from Table B, the Select statement will still include the join to Table A because it is enforced. Conversely, selecting only from Table A with the same join condition will not cause the join to Table B to be enforced.

Enforced To:
When you select this option, if the "from" table for the link is used, the link is enforced. For example, if you create a link from Table A to Table B using Enforce To and select only a field from Table A, the join to Table B will be enforced, and the Select statement that is generated will include both tables.

frodoman
0
 

Author Comment

by:trs28
ID: 16895556
well, i've read that ... but i'm looking more for a "real life" example where enforcing might be beneficial to use rather than just the general description.   thanks though!
0
 
LVL 42

Expert Comment

by:frodoman
ID: 16896157
Real life example:  Say you have a table containing employees and another table containing job descriptions.  You'll want to enforce links if you wanted a list of job descriptions that have matching employees.  You won't enforce links if you want a list of all job descriptions, whether or not you have any employees with that job.

That's a highly simplified example but it should illustrate the point somewhat.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 16

Expert Comment

by:wykabryan
ID: 16896264
Are you using Business view in BOE?
0
 

Author Comment

by:trs28
ID: 16896396
wykabryan -
     I'm using Crystal Reports XI Developer to do internal and application reporting.  

frodoman -
     I see where you're going with that, but couldn't you accomplish the same thing with an inner join?  Elaborate on that a bit if you    
     wouldn't mind.  Here's where I'm going with that... For example, tell me how you'd setup your two tables (i.e. the way you'd
     connect them & on what fields, which way you enforce a link, etc.).  If you could do that, and then tie that back to why you
     enforced a like and what it will do for you (relating to your scenerio above), that'd be damn wonderful!   Thanks!


(by the way, i bumped the points up a little for ya)
0
 
LVL 42

Accepted Solution

by:
frodoman earned 175 total points
ID: 16897632
trs28,

Yes, you could accomplish the same thing with an inner join or outer join.  My understanding (and I'm not a DBA so this isn't my best topic of discussion) is that 'enforce from' and 'enforce to' basically are the equivalent of joins.  

Maybe if you can explain where you are seeing this used it would help?  Where I've seen it, is a case where relationships between tables are pre-defined but you're pulling a query that may or may not use the defined relationship (enforce both = inner join, enforce from / to = outer join left / right).

frodoman
0
 

Author Comment

by:trs28
ID: 16906974
Well I've noticed the option when I've connected tables when doing a new report in crystal.  I'm doing a report now that has me connecting custom datasets with more custom datasets to views ... it's a mess, but it's the best way to do what I'm accomplishing ...and I'm having trouble getting some of the data to appear ... so I figured, "hey, why not ask on experts exchange and see what everyone has to say"
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now