?
Solved

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

Posted on 2006-06-13
9
Medium Priority
?
503 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
7 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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 700 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month17 days, 2 hours left to enroll

862 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