Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 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!
 External Development Forums - SalesLogix OLEDB Provider
Forum to discuss using the SalesLogix OLE DB Provider from external applications (including usage of built-in provider procedures). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix OLEDB Provider | New ThreadView:  Search:  
 Author  Thread: Update based on other table fails under 7.2
Tony Holderness
Posts: 11
 
Update based on other table fails under 7.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Jun 08 4:43 PM
I am converting a VB6 program which runs succesfully under 6.1 but fails with parse error under 7.2.

under 7.2, strsql = "update C_ACC_SELLOUTEXT set t01=1" works but:

strsql = "update sysdba.C_ACC_SELLOUTEXT set t01=sysdba.C_ACC_SELLOUT.invoicevalue, " & _
"c01=sysdba.C_ACC_SELLOUT.costvalue, u01=sysdba.C_ACC_SELLOUT.quantity" & _
" FROM sysdba.C_ACC_SELLOUTEXT, sysdba.C_ACC_SELLOUT " & _
"where month (sysdba.C_ACC_SELLOUT.invoicedate)=1" & _
" and sysdba.C_ACC_SELLOUT.C_ACC_SELLOUTID = sysdba.C_ACC_SELLOUTEXT.C_ACC_SELLOUTID"

fails with Error: -2147211398 Failed to parse SQL

The same code works under 6.1.

In both cases I use the SalesLogix OLEDB provider . Is this a problem in the 7.2 provider?
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: Update based on other table fails under 7.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Jul 08 6:41 AM
Cannot do an "Update... from..."

You have to use the "sub-select approach.
EX:

Update Table1 Set Field1 =
(Select Field2 From Table2 Where Table1.KeyField = Table2.KeyField)

..another

--HowTo - Update from another table using SubSelects

UPDATE sysdba.CONTACT
SET ACCOUNT = (SELECT a.ACCOUNT
FROM ACCOUNT a
WHERE CONTACT.ACCOUNT = a.ACCOUNTID)
WHERE ISNULL(CONTACTID, '') = '' AND
USERFIELD10 <> '' AND
EXISTS (SELECT *
FROM ACCOUNT a
WHERE CONTACT.ACCOUNTID = a.ACCOUNTID)



--
RJLedger - rjlSystems
"...Customer First..."
[Reply][Quote]
Tony Holderness
Posts: 11
 
Re: Update based on other table fails under 7.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Jul 08 7:13 AM
Bob
Thanks very much for the help. It worked.

However, it does have a weakness in that trying to update multiple fields in the same statement is a problem. In my case, I was able to get round it by modifying an earlier statement to push all the data needed for the query into the same table, which blew my normalization, but at least got me over the problem.
[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/22/2024 9:12:36 PM