The error in the previous requirement document resulted in the fact that the originally three-digit number was not fixed, and later it was found that the requirement document had mistaken the requirement. The pure number in this field must be three digits.
This field currently has thousands of rows of data, including a combination of letters, numbers, and numbers. The number of digits is not fixed. therefore, you can only write a script to update data, but oracle does not judge whether it is a numeric or a letter type data function. it can only be changed. the complete example is as follows (update the codevalue field in all data rows with typecode = 'fenju' to ensure that the original numeric data has a fixed length of three bits ):
Update Intf_Datadict t Set t. codevalue =
(Case lower (t. codevalue)
When upper (t. codevalue) Then
Case length (t. codevalue)
When 3 Then t. codevalue
When 2 Then '0' | t. codevalue
When 1 Then '00' | t. codevalue
End
Else t. codevalue
End
)
Where t. typecode = 'fenju ';
Author: "insects cool"