position(java.lang.String searchstr, long start) - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantage™

Retrieves the character position at which the specified search string begins within the CLOB value that this Clob object represents. The search for searchstr begins at position start.

If the search is successful, position() returns the position at which the search string begins; otherwise, position() returns a value of -1.

Syntax

position(java.lang.String searchstr, long start)

Syntax Elements

searchstr
The string for which to search.
The first character is at position 1.
start
The position at which to begin searching.
The first position is 1.

Exceptions

IF … THEN position() throws an SQLException to …
there is an error accessing the CLOB value indicate a failure while reading LOB data, setting the SQLException fields as follows:
  • SQLState Field = “TS000”
  • vendorCode Field = 7851
the searchstr argument is null

-or-

the value of the start argument is less than 1

indicate an invalid argument, setting the SQLException fields as follows:
  • SQLState Field = “22023”
  • vendorCode Field = 7859
the JVM cannot allocate enough memory for the method to search for the specified string indicate that available JVM heap memory has run out, setting the SQLException fields as follows:
  • SQLState Field = “TS000”
  • vendorCode Field = 7856