What is cast function, when and where do you use this?

Questions by Rajani   answers by Rajani

Showing Answers 1 - 0 of 0 Answers

CAST is a complex function that transforms one or more values from one data type into another.
.-<< , <<-----------.
V |
>>-CAST--(----source_expression +-- AS--DataType---------------->

>--+-------------------+--+----------------------+-------------->
'-CCSID--expression-' '-ENCODING--expression-'

>--+--------------------+--+---------------------+--)----------><
'-FORMAT--expression-' '-DEFAULT--expression-'

In practice, you cannot specify all of the above parameters at the same time. For example, CCSID and ENCODING parameters take effect only on string-to-string conversions, while FORMAT applies only to string-numeric and string-datetime conversions (in either direction).

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions