COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: yogeswari on 03 Feb 2015 04:28:14 AM

Title: how to convert string datatype to integer in cognos
Post by: yogeswari on 03 Feb 2015 04:28:14 AM
Hi,

Can anyone tell me how to convert string datatype to integer in cognos.  I had used the below functions such as
To_Number(), cast().  But i am getting the below errror continuously.

UDA-SQL-0114 The cursor supplied to the operation "sqlOpenResult" is inactive.UDA-SQL-0107 A general exception has occurred during the operation "open result".ORA-01722: invalid number

Also i am mentioning the datatype in FM is characterlength16.  I need to change this to number in report studio.  Please advise.  I tried by using above funcitons but still getting the error.

Thanks.

Title: Re: how to convert string datatype to integer in cognos
Post by: mitali on 03 Feb 2015 04:34:32 AM
what kind of data values you have,please mention.

cast([Report Studio object],int)

are you using this syntax only
Title: Re: how to convert string datatype to integer in cognos
Post by: yogeswari on 03 Feb 2015 04:39:12 AM
hi, Thanks for your response.
I have used like below:
cast([Subsdry Acct No], integer)
cast([Subsdry Acct No], number)
cast([Subsdry Acct No], numeric)

I tried like the above options but getting error.
I am cognos 10.2.1 version and backend is Oracle.

The datatype of [Subsdry Acct No] is characterlength16.

Thanks.
Title: Re: how to convert string datatype to integer in cognos
Post by: mitali on 03 Feb 2015 04:44:43 AM
try to change different column with length of 4 or 5
Title: Re: how to convert string datatype to integer in cognos
Post by: yogeswari on 03 Feb 2015 04:53:49 AM
I am getting ur point?

What to change?
Title: Re: how to convert string datatype to integer in cognos
Post by: mitali on 03 Feb 2015 05:15:21 AM
try to change any different string column into integer
Title: Re: how to convert string datatype to integer in cognos
Post by: MFGF on 03 Feb 2015 05:21:55 AM
Can you tell us what the values in [Subsdry Acct No] look like? If they contain alphabetic characters you are not going to be able to cast them as numbers.

MF.
Title: Re: how to convert string datatype to integer in cognos
Post by: Robl on 03 Feb 2015 06:19:16 AM
Give us a few examples of the numbers.
Also, try and find some empty/blank rows if there are any and see if it's a null or a space.

Title: Re: how to convert string datatype to integer in cognos
Post by: yogeswari on 03 Feb 2015 06:34:15 AM
Thanks all for your response.
Especially MFGF you are correct.

The value of [Subsdry Acct No]  contains combination of alphabets and numbers.  So i am unable to convert that into number.

Eventhough it is so simple, It took more time to predict this issue.  Thank you  all of your responses. :)