Class InStrSqlFunction

java.lang.Object
com.gigaspaces.query.sql.functions.SqlFunction
com.gigaspaces.query.sql.functions.InStrSqlFunction

public class InStrSqlFunction extends SqlFunction
Built in string sql function to get the position of the first occurrence of a substring in a string.
Since:
11.0.0
Author:
Tamir Schwarz
  • Constructor Details

    • InStrSqlFunction

      public InStrSqlFunction()
  • Method Details

    • apply

      public Object apply(SqlFunctionExecutionContext context)
      inStr is an SQL convention (Not Java's), in the sense that the first index is 1 and not 0.
      Specified by:
      apply in class SqlFunction
      Parameters:
      context - contains two arguments of type string.
      Returns:
      the index of the first occurrence of context.getArgument(1) in context.getArgument(0). If not a substring, return value of 0.