SQLike routine - Cloud - 8.0

Talend Data Fabric Studio User Guide

Version
Cloud
8.0
Language
English (United States)
EnrichDitaval
Data Fabric
Product
Talend Data Fabric
Module
Talend Studio
Content
Design and Development

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)