GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Data Warehousing  >  Abinitio
Next Question 
 Abinitio  |  Question 1 of 189    Print  
What is the function you would use to transfer a string into a decimal?

  
Total Answers and Comments: 5 Last Update: August 18, 2007   
  
 Sponsored Links



 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
July 10, 2005 11:11:58   #1  
Ashim Dutta        

RE: What is the function you would use to transfer a string into a decimal?
In this case no specific function is required if the size of the string and decimal is same. Just use decimal cast with the size in the transform function and will suffice. For example, if the source field is defined as string(8) and the destination as decimal(8) then (say the field name is field1). 
 
out.field :: (decimal(8)) in.field 
 
If the destination field size is lesser than the input then use of string_substring function can be used likie the following. 
say destination field is decimal(5). 
 
out.field :: (decimal(5))string_lrtrim(string_substring(in.field,1,5)) /* string_lrtrim used to trim leading and trailing spaces */ 
 
Hope this solution works.

 
Is this answer useful? Yes | No
April 20, 2006 16:03:38   #2  
jyothi        

RE: What is the function you would use to transfer a s...
i want a clear explanaion for this question .can anyone help me?
 
Is this answer useful? Yes | No
November 29, 2006 11:47:59   #3  
sangee        

RE: What is the function you would use to transfer a s...
i think we can go for decimal strip function in our transform .we can also do by using casting function.
 
Is this answer useful? Yes | No
December 07, 2006 04:56:37   #4  
mukund        

RE: What is the function you would use to transfer a s...

Hey,

use ""reinterpret_as" function to convert string to decimal,or decimal to string.

syntax:  To convert decimal onto string

reinterpret_as(ebcdic string(13),(ebcdic decimal(13))(in.cust_amount))

Cheers,

Mukund


 
Is this answer useful? Yes | No
August 18, 2007 04:44:37   #5  
chandu_swe        

RE: What is the function you would use to transfer a s...

To change string to decimal we use atoi function.


 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    


 
Go To Top


 Sponsored Links



 
Sponsored Links

 
Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape