8/5/2026 2:05:54 PM
|
| |
| 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.
|
|
|
|
SQL Update Statement Help
Posted: 18 Feb 08 7:37 AM
|
I am trying to update all contacts which are the ONLY contact for an account to make them the primary contact. I tried executing the following SQL statement in the SLX Administrator, but I get errors: Failed to parse SQL update contact set isprimary = 'T' from contact c1 INNER JOIN ( select accountid from contact group by accountid HAVING COUNT(*) = 1 ) c2 ON c1.accountiD = c2.accountid where (isprimary is null or isprimary = 'F')
I then tried using a temp table to hold the account ids to be updated instead of the subquery, but that didn't work either. It doesn't seem to be able to create tables using a script. Both queries work fine in SQL Server Query Analyzer, but I need the changes to be synched down to the remote databases, so I need to run them in the SLX Admin. I am on SLX ver 6.1.3 Any suggestions? |
|
|
|
Re: SQL Update Statement Help
Posted: 18 Feb 08 4:41 PM
|
The SLX OLEDB provider does not support UPDATE ... FROM ... queries, so forget that.
If you can recast your query to use a subquery instead, it has a far greater chance of running.
UPDATE CONTACT SET IsPrimary = 'T' Where Contact.ContactID IN (Select c2.ContactID from Contact C2 ......)
6.1.3 ... that was a long time ago - good luck.
Phil |
|
|
| |
|
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!
|
|
|
|
|
|
|
|