8/27/2025 1:27:29 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 writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
SQL Statement Help: copying data from one field to another
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 |
|
|
|
Re: SQL Statement Help: copying data from one field to another
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 |
|
|
|
Re: SQL Statement Help: copying data from one field to another
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 |
|
|
| |
|
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!
|
|
|
|
|
|
|
|