Thursday, July 22, 2021

OIC - substring a string using index-within-string() function.

Suppose we have a variable which contains a string like "a/b/c/d.txt;name=value" and we need to take the value before the searchstring(;) then that we can achieve following 2 ways:

1. Using substring-before():

substring-before($string,";")

2. Using substring() and index-within-string() functions;

substring($string,1,oraext:index-within-string($string,";")

This function(index-within-string()) returns the zero based index of the first occurance od search string within the input string. The function returns -1 if search string is not found.


No comments:

Post a Comment

Featured Post

OIC - Fixing WSDL Import and Element Errors While Configuring External Partner Adapters in Oracle Integration (OIC)

Fixing WSDL Import and Element Errors While Configuring External Partner Adapters in Oracle Integration (OIC) Use Case: An external partne...