11/26/2024 10:26:15 AM
|
|
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!
Forum to discuss SQL Server or Oracle database administration related to SalesLogix databases. View the code of conduct for posting guidelines.
|
|
|
|
Broken Joins
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 |
|
|
|
Re: Broken Joins
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<>'*' |
|
|
| |
|
Re: Broken Joins
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? |
|
|
| |
|
Re: Broken Joins
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. |
|
|
| |
|
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!
|
|
|
|
|
|
|
|