Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Administration Forums - Database Administration
Forum to discuss SQL Server or Oracle database administration related to SalesLogix databases. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Database Administration | New ThreadView:  Search:  
 Author  Thread: Broken Joins
Michael Litman
Posts: 94
 
Broken JoinsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Nov 06 12:34 PM
fiogf49gjkf0d
Hello all,

Is there a query that will find broken joins? and what would be the effects in SLX of broken joins? Thanks ML
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Broken JoinsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Nov 06 2:46 PM
fiogf49gjkf0d
Here are some scripts I got from SalesLogix a long time ago.

/*The first script is for recursive joins. These should not be in the database.

Leave the join where a custom table is joined to the primary
table. Delete the other in the Join manager in the Workgroup Admin.


The second and thrid scripts will tell you joins that are to or from
tables that do not exist in you database. You want to delete all of
the bad joins.

NOTE: To delete system joins, you must issue a delete from command
to the join table directly (some in i.e. secplugin) because the
join manager will not let you delete system joins.

Additionally, IF you have remotes, you must do all the statement in
Execute SQL within Workgroup Admin so you can sync it out to them.

*/

/* Check for recursive joins. */
SELECT J1.FROMTABLE FROMTABLE1, J1.FROMFIELD FROMFIELD1,
J1.TOTABLE TOTABLE1, J1.TOFIELD TOFIELD1
FROM SYSDBA.JOINDATA J1, SYSDBA.JOINDATA J2
WHERE J1.FROMTABLE = J2.TOTABLE
AND J1.TOTABLE = J2.FROMTABLE
AND J1.FROMFIELD = J2.TOFIELD
AND J1.TOFIELD = J2.FROMFIELD


/* Bad to join */
SELECT J.FROMTABLE AS 'FROM TABLE NAME', J.TOTABLE AS 'TO TABLENAME',
JOINID, J.FROMTABLE +' IS THE INCORRECT ENTRY' AS 'MESSAGE' FROM
SYSDBA.JOINDATA J LEFT OUTER JOIN SYSOBJECTS SO1 ON J.FROMTABLE=SO1.NAME
WHERE (J.FROMTABLE NOT IN(SELECT NAME FROM SYSOBJECTS))
AND J.FROMTABLE<>'*'



/* bad from join */
SELECT J.TOTABLE AS 'TO TABLE NAME',J.FROMTABLE AS 'FROM TABLENAME',
JOINID, J.TOTABLE+' IS THE INCORRECT ENTRY' AS 'MESSAGE' FROM
SYSDBA.JOINDATA J
LEFT OUTER JOIN SYSOBJECTS SO2 ON J.TOTABLE=SO2.NAME
WHERE (J.TOTABLE NOT IN(SELECT NAME FROM SYSOBJECTS))
AND J.FROMTABLE<>'*'
[Reply][Quote]
Michael Litman
Posts: 94
 
Re: Broken JoinsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Nov 06 3:10 PM
fiogf49gjkf0d
Thanks for the help Frank But alas all three returned nothing from execute query as does a circular joins query.

At this point I will give you a little more info on the problem.

A user is building query's in querybuilder when they run the query they get extranous results that don't comform to the condition set in the query for example:

They have built a query for all opportunities lost. the condition is opp.status = closed - lost but in the result set we see closed - won, active and inactive. When I run the SQL (copied from the query builder) it returns the correct data but in SLX it returns the extranous data as well.

At this point we have tried everything we can think of, Any ideas on what we can do to correct the problem of this data being returned that is against the condition?
(we did try the distinct record setting as well)

Thanks for all the help ML
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Broken JoinsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Nov 06 3:22 PM
fiogf49gjkf0d
OK now I have a clearer picture.

Questions...
1. What version of SalesLogix are you running and what hotfixes do you have installed?
2. Is the user a remote user or a network user?
3. What happens if you execute the SQL via the Execute SQL function in the WGAdmin?
4. What happens if you logon as ADMIN and view the group?
5. How do you have Account ownership setup at your site?
6. Can you post the SQL?
[Reply][Quote]
Michael Litman
Posts: 94
 
Re: Broken JoinsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Nov 06 3:32 PM
fiogf49gjkf0d
We are running 6.2.3.1092 which is SP3 no hotfixes.
it is a network user.
when I execute the SQL in the WGadmin it returns the correct data
as admin I see the same extra records
Ownership is a good question we have user that own records teams that own and depts that own as well as the occasional everyone

SELECT A1.OPPORTUNITYID, A1.ACCOUNTMANAGERID, A1.DESCRIPTION, A1.ESTIMATEDCLOSE, A1.ACTUALCLOSE, A1.STAGE, A1.REASON, A1.SECCODEID, A1.STATUS, A2.ACCOUNT A2_ACCOUNT FROM OPPORTUNITY A1 INNER JOIN ACCOUNT A2 ON (A1.ACCOUNTID=A2.ACCOUNTID) WHERE (A1.STATUS='Closed - Lost') ORDER BY A1.ACCOUNTMANAGERID ASC

Thanks again ML
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Broken JoinsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Nov 06 4:29 PM
fiogf49gjkf0d
The SQL from the Query builder looks OK. Something strange is going on. Maybe the group is corrupted in some strange invisible way.

I would suggest that you create a new group using a different name. When you create the new group leave out the join to the account table. Don't bother with the displaying the account and forget about the sorting.

Once you have something that works you can add in the additional informaiton.
[Reply][Quote]
Michael Litman
Posts: 94
 
Re: Broken JoinsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Dec 06 3:54 PM
fiogf49gjkf0d
Thanks for the help Frank I have found out what is going on it is a know issue from SLX fixed in hotfix3 for 6.2.3. There is a filtering problem within the client software and hotfix 3 fixes it. Thanks again ML
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/26/2024 11:02:00 AM