index_of function

The index_of function determines the position of the first character of the search string at its first occurrence if any.

returnvalue index_of(source, search_string [, start_position])

source ::= any*
search_string ::= any*
start_position ::= integer*
returnvalue ::= integer

Various return values:

Example 1 - Determine at which position “-“ is found in the estimated arrival time of the first leg for the passenger with ticket number 1762320569757.

SELECT index_of(bag.baginfo.flightLegs[0].estimatedArrival,"-")
FROM BaggageInfo bag
WHERE ticketNo=1762320569757

Output:

{"Column_1":4}

Example 2 - Determine at which position “/” is found in the routing of the first leg for passenger with ticket number 1762320569757. This will help you determine how many characters are there for the source point for the passenger with ticket number 1762320569757.

SELECT index_of(bag.baginfo.routing,"/")
FROM BaggageInfo bag
WHERE ticketNo=1762320569757

Output:

"Column_1":3}