1.

What Is The Function That Transfers A String Into A Decimal?

Answer»

Use decimal cast with the size in the transform() function, when the size of the STRING and decimal is same.

Ex: If the source field is defined as string(8).

- The DESTINATION is defined as decimal(8) 

- Let us ASSUME the field NAME is salary.

- The function is out.field :: (decimal(8)) in salary

- If the size of the destination field is lesser that the input then string_substring() function can be used

Ex : Say the destination field is decimal(5) then use…

- out.field :: (decimal(5))string_lrtrim(string_substring(in.field,1,5))

- The ‘ lrtrim ‘ function is used to remove leading and trailing spaces in the string

Use decimal cast with the size in the transform() function, when the size of the string and decimal is same.

Ex: If the source field is defined as string(8).

- The destination is defined as decimal(8) 

- Let us assume the field name is salary.

- The function is out.field :: (decimal(8)) in salary

- If the size of the destination field is lesser that the input then string_substring() function can be used

Ex : Say the destination field is decimal(5) then use…

- out.field :: (decimal(5))string_lrtrim(string_substring(in.field,1,5))

- The ‘ lrtrim ‘ function is used to remove leading and trailing spaces in the string



Discussion

No Comment Found