Solved

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

Posted on 2006-06-13
9
483 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

691 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