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: Execute SQL Problem
Ian Fitzpatrick
Posts: 146
 
Execute SQL ProblemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Jun 06 3:30 PM

zovirax

zovirax
fiogf49gjkf0d
I am trying to execute a SQL statement on the host and all of my remote databases, so I am using the execute SQL feature in Workgroup Admin, but it is kicking my statement out. This is SLX v.5.2.
Here is the statement:
update sysdba.contact set account = 'Stuart Securities Corp (Hub)' where account = 'W.H. Stuart & Associates (Hub)'
and here is the Error:
The Statement failed and returned the following error. Subquery returned more than 1 value and that is not permitted when subquery follows =, !=, <, <=, >, >= or when the subquery "

Any ideas?
I changes the query to search for contactid in (Select contactid from contact where account = 'W.H. Stuart & Associates (Hub)') but that didn't work either.

I'm going out of my mind!!

[Reply][Quote]
Carla Tillman
Posts: 290
 
Re: Execute SQL ProblemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Jun 06 4:44 PM

pillola cialis controindicazioni

acquistare cialis con paypal
fiogf49gjkf0d
You are working from the conact level. Account to Contact is a 1 to many

update sysdba.contact set account = 'Stuart Securities Corp (Hub)' where account = 'W.H. Stuart & Associates (Hub)'


Try this

update sysdba.contact
set account = 'Stuart Securities Corp (Hub)'
from Contact, Account
where contact.accountid = account.accountid
AND Account.account = 'W.H. Stuart & Associates (Hub)'


[Reply][Quote]
Ian Fitzpatrick
Posts: 146
 
Re: Execute SQL ProblemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Jun 06 5:46 PM
fiogf49gjkf0d
I'm actually working at the contact level. What happened is that a user changed the account name at the account level but this doesn't change the name on the hyperlink of the contact detail view. The contact table has a field called "account" that is used to display that name. So, of course, my users can't click on a hyperlink with the old name, so we have to do something!

It's totally stupid but true.
[Reply][Quote]
Carla Tillman
Posts: 290
 
Re: Execute SQL ProblemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Jun 06 9:35 PM

albuterol otc names

albuterol otc
fiogf49gjkf0d
There may be other issues here, but try this one:


update sysdba.contact
set account = 'Stuart Securities Corp (Hub)'
where contact.accountid = 'The accountID'

Else you may need to do something like the following. Note: This will update ALL records

update account
set account = AccountSummary.account
from Account, AccountSummary
AND AccountSummary.account <> account.account

update Contact
set account = Account.account
from Contact, Account
AND contact.account <> account.account
[Reply][Quote]
Carla Tillman
Posts: 290
 
Re: Execute SQL ProblemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Jun 06 7:51 AM

naltrexone online

naltrexone low dose
fiogf49gjkf0d
Oops I forgot to mention a OOTB SLX tool; Integrity Checker. You can run checks against your DB for incorrect data. Add the "Show SQL" checkbox status and test. It will give you a run down of your data. Example of an Account test below.

WGAdmin | Tools | Integrity Checker


>> Bad Account Mirrors (Uppercase) <<
SELECT COUNT(ACCOUNTID) FROM ACCOUNT WHERE ACCOUNT_UC <> UPPER(ACCOUNT) OR (ACCOUNT_UC IS NULL AND ACCOUNT IS NOT NULL)
0 records found



Carla
[Reply][Quote]
Ian Fitzpatrick
Posts: 146
 
Re: Execute SQL ProblemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Jun 06 11:05 AM

coupons for cialis

prescription drugs discount cards click here
fiogf49gjkf0d
Integrity Checker, of course! Actually, I wound up selecting all of the Contact ids, from the contact table that had the old name and then cutting and pasting them into an update statement:
"update contact set account = 'Stuart Securities Corp (Hub)'
where contactid = 'whatevercontactid'"

There were only 44 this time, but I will need a more elegant solution for next time. The statement that you are talking about is at the Account level, I am trying to update the account field at the contact level. I looked in the integrity checker and they are not looking at this field. Do you happen to know what type of SQL syntax that SalesLogix uses in this Execute SQL, I think I have read something about a specific SQL syntax that execute SQL uses but I forget it now.
[Reply][Quote]
Ian Fitzpatrick
Posts: 146
 
Re: Execute SQL ProblemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Jun 06 12:18 PM

bentelan a cosa serve

bentelan fiale 4 mg
fiogf49gjkf0d
I got it!
Ok, so maybe I stole it from this post:
SQL 92 from the T-Sql Discussion on SLXDeveloper.com
But it still works!

select
'UPDATE sysdba.contact set account = ''Stuart Securities Corp (Hub)'' where Contactid = ''' + sysdba.contact.Contactid + ''''
FROM sysdba.Contact
WHERE sysdba.contact.account = 'W.H. Stuart & Associates (Hub)'

Thank you for your help Carla!
[Reply][Quote]
Tim Montgomery
Posts: 23
 
Re: Execute SQL ProblemYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jun 06 4:12 PM
fiogf49gjkf0d
You can select "show sql statements" when you run the Integrity Checker
[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 3:16:58 AM