The original work has some problems in SQL 2000. Fixed the error and ran it in SQL 2000.
/***************************************************** ****
Author: (wleii165@yahoo.com)
Version: 1.0
Creation time: 20020227
Modification time:
Function: Convert lowercase amounts to uppercase
Parameters: n_LowerMoney lowercase amount
v_TransType type-- 1: directly translate, 0: read it in words
Output: uppercase amount
********************** *************************************/
CREATE PROCEDURE dbo.L2U
(
@n_LowerMoney numeric(15,2),
@v_TransType int,
@RET VARCHAR(200 ) output
)
AS
Declare @v_LowerStr VARCHAR(200) -- lowercase amount
Declare @v_UpperPart VARCHAR(200)
Declare @v_UpperStr VARCHAR(200) -- uppercase Amount
Declare @i_I int
set nocount on
select @v_LowerStr = LTRIM(RTRIM(STR(@n_LowerMoney,20,2))) --Round to the specified precision and delete left and right spaces in the data
select @i_I = 1
select @v_UpperStr = ''
while ( @i_I <= len(@v_LowerStr))
begin
select @v_UpperPart = case substring(@v_LowerStr,len( @v_LowerStr) - @i_I 1,1)
WHEN '.' THEN '元'
WHEN '0' THEN 'zero'
WHEN '1' THEN '壹'
WHEN '2' THEN '二'
WHEN '3' THEN '三'
WHEN '4' THEN '四'
WHEN '5' THEN '五'
WHEN '6' THEN 'Lu'
WHEN '7' THEN '柒'
WHEN '8' THEN '捌'
WHEN '9' THEN '玖'
END
case @i_I
WHEN 1 THEN 'fen'
WHEN 2 THEN 'angle'
WHEN 3 THEN ''
WHEN 4 THEN ''
WHEN 5 THEN 'Shi'