My Oracle Support Banner

IScript Function Call to strToLong Does Not Return Expected Result For Alphanumeric Input (Doc ID 1265576.1)

Last updated on AUGUST 22, 2018

Applies to:

Oracle Communications Billing and Revenue Management - Version and later
Information in this document applies to any platform.
***Checked for relevance on 25-Oct-2013***


How to workaround when function call strToLong does not return the expected result for alphanumeric input?

Per document:
strToLong ---> This function converts a string value to a Long value.
Returns the string converted to a Long value if the function is successful.
Returns 0 if the string is not a valid Long value.

But after applying this function to the string "598*111" the return value its 598.
When the expected result its 0 for "598*111" as it's not a valid Long

1) Provide the below iScript : (ISC_Rakesh.isc)

File out;
Long val;

if ( fileOpen (out, "/pinhome/pin7911/opt/ifw/test1.txt", "w" ) == true )
   fileWriteStr ( out, "Hello World!\n" );
   val = strToLong("598*111");
   fileWriteLong ( out, val );

under $IFW_HOME/iScriptLib/iScriptLib_Standard

2) start_ifw;stop_ifw

getting the below output :

XXX 156mui> cat test1.txt
Hello World!


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.