1

In Pervasive SQL version 11, is there a native function that I can use inside a select clause that will return the index location of a character within a string?

I found this: http://help.pervasive.com/display/DI1025/InStrRev+Function

But, when I use it in a normal select-query, execution fails with reason: "Invalid user-defined or scalar function." I'm apparently looking in the wrong place for native functions that work in Pervasive SQL statements alone (without scripting).

MS SQL Server has a function called charindex, that does what I'm trying to do in Pervasive SQL. Does Pervasive SQL have an equivalent?

Lonnie Best
  • 9,936
  • 10
  • 57
  • 97

1 Answers1

1

LOCATE (string1, string2 [, start ])

Returns the starting position of the first occurrence of string1 within string2. The search within string2 begins at the first character position unless you specify a starting position (start). The search begins at the starting position you specify. The first character position in string2 is 1. The string1 is not found, the function returns the value zero.

Lonnie Best
  • 9,936
  • 10
  • 57
  • 97