Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, August 27, 2025 
 
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!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: SQL Statement Help: copying data from one field to another
Gareth Hall
Posts: 8
 
SQL Statement Help: copying data from one field to anotherYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Nov 08 9:35 AM
Hi all,

I have a user that has used the sub-type field (as it is not used at the moment) and has used it to label accounts as Key, General & Maintenance.

I have created a new field with picklist and want to insert all the data he has input into the new picklist field.

I tried to use;

INSERT INTO E1TB_ACCEXT (Account_Classification)
SELECT SUBTYPE
FROM ACCOUNT

but this gives me the error;

Server: Msg 2601, Level 14, State 3, Line 1
Cannot insert duplicate key row in object 'E1TB_ACCEXT' with unique index 'E1TB_ACCEXT_PRIMARY'.
The statement has been terminated.

Any help would be gratefully appreciated.

Thanks,

Gareth
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: SQL Statement Help: copying data from one field to anotherYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Nov 08 4:25 PM
So you are trying to move all of the data from Account.Subtype to E1TB_ACCEXT.Account_Classification?

Is there a 1:1 relationship between the tables?

Does a record already exist in E1TB_ACCEXT for every record in Account?

If so, you need a cross-table UPDATE, not an INSERT.

If not, you need to create the records - similar to what you are doing above, but you need to ensure that the PK and AccountID fields are also populated. Setting the PK to Autoincrement will help you here.

Phil
[Reply][Quote]
Gareth Hall
Posts: 8
 
Re: SQL Statement Help: copying data from one field to anotherYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Nov 08 3:42 AM
Hi Phil,

Yes i am trying to move all the data and basically ovewrite the data in Account Classification (all Null)

How would i check the relationship between the tables?

I have searched doing a cross table update on the net but cant find any examples.

Gareth
[Reply][Quote]
Gareth Hall
Posts: 8
 
Re: SQL Statement Help: copying data from one field to anotherYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Nov 08 6:35 AM
I have sorted this now.

Thanks
[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 © 2025 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): 8/27/2025 8:54:45 AM