SQLike routine - Cloud - 8.0

Talend Studio User Guide

Version
Cloud
8.0
Language
English
Product
Talend Big Data
Talend Big Data Platform
Talend Cloud
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Design and Development
Last publication date
2024-02-29

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.

Functions of the SQLike routine

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-1 delimiters is returned; if count is negative, the right most substring that contains -count-1 delimiters is returned.

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

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