Home
|
Forums
|
Contact
|
Search
|
Syndication
[login]
[create account]
Monday, November 25, 2024
slxdeveloper.com
Home
Search
Contact us
About slxdeveloper
Syndication
Community
Forums
(NEW!)
Newsletter Archive
Members
Your Profile
Submit Article
General
Administration
(6)
OLE DB Provider
Miscellaneous
(2)
Architect
VBScript
(9)
ActiveX Controls
(6)
How To's
(14)
.NET Extensions
(3)
External
OLE DB Provider
(12)
SLAPI (SlgxApi.dll)
SalesLogix COM
(1)
Web
ASP/ASP.NET
(2)
Web Services
Web Client
Downloads
Samples
(17)
Documentation
(7)
Utilities
(18)
Resources
SalesLogix
(3)
Programming
(1)
11/25/2024 2:21:26 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!
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 Thread
View:
Dynamic
Flat
Tree
Search:
Author
Thread: SQL Update Statement Help
Bailey1
Posts: 57
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?
[
Reply
][
Quote
]
Phil Parkin
Posts: 819
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
[
Reply
][
Quote
]
Bailey1
Posts: 57
Re: SQL Update Statement Help
Posted: 19 Feb 08 7:11 AM
Thanks - that worked!
[
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
|
page cache (param): 11/25/2024 2:25:31 PM