Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, November 27, 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!
 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: Remove white space at end of 'description' field in 'product' table?
Darren Savery
Posts: 51
 
Remove white space at end of 'description' field in 'product' table?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 4:43 AM
fiogf49gjkf0d
Hi,

I have found that I have quite a few instances where the 'description' field in the 'product' table has erronous white space at the end of them. I need to remove these somehow. However, I have two issues:

1) The 'description' field is a TEXTBLOB field so I can't seem to run the 'RTRIM(description) function on it.
2) I have synchronisatino set up for SLX so I need all changes to go through the SLX interface in order to sync out.

Can anyone help me with this one?

Thanks,

Darren
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Remove white space at end of 'description' field in 'product' table?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Feb 07 9:51 AM
fiogf49gjkf0d
If you know you don't have text in that field longer than 8000 you could do this (if you have longer text then you'll be truncating it with this method). Of course you'd execute this via ExecuteSQL in the administrator so it will sync. BTW, this is not tested so I trust you'll do that before doing in production. Also, I don't know if the SLX provide will choke on this one or not.

update product set description = rtrim(cast(description as varchar(8000)))


Another approach is to write a quick script to clean the data. Pretty simple. Here's a sample (this is also completely untested code, so make sure you test this before running in your production system)

Dim rs

Set rs = CreateObject("ADODB.Recordset")
With rs
Set .ActiveConnection = Application.GetNewConnection
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic

.Open "select * from product where description is not null"

While Not .EOF
.Fields("description").Value = Trim(.Fields("description").Value)
.Update
.MoveNext
Wend
.Close
End With
Set rs = Nothing
[Reply][Quote]
Darren Savery
Posts: 51
 
Re: Remove white space at end of 'description' field in 'product' table?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Feb 07 4:48 AM
fiogf49gjkf0d
Hi Ryan,

Thanks for the answer.....and thanks for making me feel small for not being able to find out how to do it!!!!

I treid so many different things...just not that one!

Thanks!

Darren
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Remove white space at end of 'description' field in 'product' table?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Feb 07 10:11 AM
fiogf49gjkf0d
Quote:
Originally posted by Darren Savery

....and thanks for making me feel small for not being able to find out how to do it!!!!


Hi Darren, hope that's not the case, we're all here to share and learn
[Reply][Quote]
Darren Savery
Posts: 51
 
Re: Remove white space at end of 'description' field in 'product' table?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Feb 07 10:12 AM
fiogf49gjkf0d
Just one of those days Ryan - I couldn't see the wood for the trees
[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/27/2024 4:51:36 AM