Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP9 updates to VarChar in SQL 2K leaves padded result
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
01168557
Message ID:
01168597
Views:
13
That's an intereting idea; had not thought along these lines.

Ironically, the 'serial_no' field being chosen in the initial SELECT statement from the SERHIST table is already a VarChar so casting that field would obviously be self defeating and would not work.

However - it would be worth trying casting the result of the update source data instead of ALLTRIMing it.

The update shown in this script is convoluted as shown because the objective is to increase an existing character 'number' by a specific numeric value. Hence the intial character number value has first to be converted to an equivalent real numeric value; then add the numeric increment of 341; then return this new numeric value to an equivalent character value without any decimal places, hence the INT conversion component in the code as shown in the original question.

So, based upon your suggestion I could try:
SET serial_no = CAST((INT(VAL(serial_no)) + 341) AS VarChar ( SQLColVarCharWidth ) ) ;
as an option and see what happens.

Thnx for the suggestion. /psb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform