SUBSTRING( string_expression, start, length )
Custom function used to emulate the behavior
string.substring( indexA [, indexB])
Input:
SELECT SUBSTRING('abcdef', 2, 3) AS SOMETEXT;
Output:
SOMETEXT|
--------+
bcd |
Code:
SELECT SUBSTRING('abcdef', 2, 3) AS SOMETEXT;
Result:
SOMETEXT|
--------+
bcd |
Code:
CREATE OR REPLACE FUNCTION REPLACER_LENGTH(str varchar, index float, length float)
RETURNS string
LANGUAGE JAVASCRIPT
AS
$$
var start = INDEX - 1;
var end = STR.length - (LENGTH - 1);
return STR.substring(start, end);
$$;
SELECT REPLACER_LENGTH('abcdef', 2, 3) AS SOMETEXT;
Result:
SOMETEXT|
--------+
bcd |
No issues were found.
No related EWIs.