Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Purpose of enforce From n enforce to Post Reply Post New Topic
Page  of 2 Next >>
Author Message
nani2020nani
Newbie
Newbie


Joined: 13 May 2009
Online Status: Offline
Posts: 14
Quote nani2020nani Replybullet Topic: Purpose of enforce From n enforce to
     Posted: 19 May 2009 at 10:13pm

hi friends

 
can u explain me ...the need for these enforce options??
avsr
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 20 May 2009 at 6:04am
what are they...I have never heard of them.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 May 2009 at 7:27am
They are in the Database Expert links, link options...
Here are the definitions from Help:
 
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 TableA to TableB using Enforce From and select only a field from TableB, the Select statement will still include the join to TableA because it is enforced. Conversely, selecting only from TableA with the same join condition will not cause the join to TableB 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 TableA to TableB using Enforce To and select only a field from TableA, the join to TableB will be enforced, and the Select statement that is generated will include both tables.
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 20 May 2009 at 10:35am
Kind of sounds like outer joins, but for Crystal to limit the amount of data that it retrieves by not looking at table if the data is not used.
IP IP Logged
nani2020nani
Newbie
Newbie


Joined: 13 May 2009
Online Status: Offline
Posts: 14
Quote nani2020nani Replybullet Posted: 20 May 2009 at 7:21pm
actly i have two tables
 
1.DEP
 
having columns
 
deptid and deptname
 
2.DEPSAL
having columns
deptid and deptsal
 
2 rows match from the two tables...i.e they have same deptid
 
now,my query fr ENFORCE FROM option with EQUALTO link type and left/right/inner join
 
FROM TABLE IS DEPSAL
TO TABLE IS DEP
 
QUERY:
SELECT "DEP"."DEPTNAME" FROM "DEP","DEPSAL"
WHERE "DEP"."DEPTID"="DEPSAL"."DEPTID"
 
BUT ITS NOT WORKING...SO PLZ HELP ME OUT....
USING ENFORCE FROM OPTION....WAT JOIN TYPE SHOULD I USE...WAT CHANGES L TAKES PLACE IF I USE DIFFERENT JOIN TYPE...INNER/LEFT/RIGHT JOINS
 
 
avsr
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 May 2009 at 7:29pm
sounds like you need just an inner join and not enforced.
When you say your query is not working what do you mean exactly?
And where are you placing the query or are you just looking a the auto-generated sql statement?
 
IP IP Logged
nani2020nani
Newbie
Newbie


Joined: 13 May 2009
Online Status: Offline
Posts: 14
Quote nani2020nani Replybullet Posted: 20 May 2009 at 8:57pm
well,
 
im trying out this enforce from options
 
waz d purpose of this enforce from....wat changes will i see by using enforce from
 
i dint find anychanges by using that query mentioned above  for 'enforce from' option.
 
plz write a query of your own and explain me abt enforce from option clearly..wat changes will takes place by using enforce from/enforce to option
avsr
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 21 May 2009 at 6:13am
From what DBlank posted about the enforce, you wouldn't see a difference.  Regardless of enforce, there would only be 1 column...the question is if it would be null...but the sql statement is an inner join, just read it, it is old syntax, implicit inner join.
 
Again, referring to the posting, it would appear that ENFORCE is a method for CRYSTAL to not process/retrieve information that is not used in the report.  When you join 2 tables with 100 columns each, but then don't reference any of the columns in one of the tables, this would allow Crystal to not retrieve the data from the unused table...regardless of join type. (this is my interpretation of what the help says)...
 
My recommendation, forget about Enforce, just use the normal SQL joins that are well documented all over the web and are easily understood.
 
And as always, get your data from a stored proc or a view...then this whole issue is gone and you are maximizing the processing power of your database software and server hardware, which is why you bought it. 
 
IP IP Logged
nani2020nani
Newbie
Newbie


Joined: 13 May 2009
Online Status: Offline
Posts: 14
Quote nani2020nani Replybullet Posted: 24 May 2009 at 9:29pm
so ther is no difference b/w joins and enforce from /to ???
avsr
IP IP Logged
nani2020nani
Newbie
Newbie


Joined: 13 May 2009
Online Status: Offline
Posts: 14
Quote nani2020nani Replybullet Posted: 24 May 2009 at 9:35pm
can ny1 explain it wid query??
avsr
IP IP Logged
Page  of 2 Next >>
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum