GeekInterview.com
Series: Subject: Topic:
Question: 12 of 211

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

Asked by: Rajani | Member Since Nov-2005 | Asked on: Nov 20th, 2011

View all questions by Rajani   View all answers by Rajani

Showing Answers 1 - 1 of 1 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).

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.