SQLike routine - 7.3

Talend Open Studio User Guide

Version
7.3
Language
English
Product
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Module
Talend Studio
Content
Design and Development
Last publication date
2023-10-11
Available in...

Open Studio for Big Data

Open Studio for Data Integration

Open Studio for ESB

The SQLike routine contains functions which allow you to extract a part of a string.

You can access these functions by double-clicking the SQLike node under the system routines folder in the Repository tree view.

Function

Description

Syntax

mid

Extracts a substring from a string, from the position specified by beginIndex. The count parameter specifies the number of characters to be extracted. If the count is not provided, this function extracts the substring from the position specified by beginIndex to the end.

Example:
  • SQLike.mid("abcdefg",3,3)
  • Output: cde

SQLike.mid(String instr,int beginIndex,[int count])

mid_index

Extracts a substring from a string. If count is positive, the left most substring that contains count-1delimiters is returned; if count is negative, the right most substring that contains -count-1 delimiters is returned.

Example 1:
  • SQLike.mid("a,bc,d,e,f,g",",",3)
  • Output: a,bc,d
Example 2:
  • SQLike.mid("a,bc,d,e,f,g",",",-3)
  • Output: e,f,g

SQLike.mid_index(String instr,String delimiter,int count)