Hello. I need to extract text from table in column with where clausule. I found solution in T-SQL but i dont know how to translate for SQL Oracle
CREATE FUNCTION dbo.str_between(@col varchar(max), @start varchar(50), @end varchar(50))
RETURNS varchar(max)
WITH EXECUTE AS CALLER
AS
BEGIN
RETURN substring(@col, charindex(@start, @col) + len(@start),
isnull(nullif(charindex(@end, stuff(@col, 1, charindex(@start, @col)-1, '')),0),
len(stuff(@col, 1, charindex(@start, @col)-1, ''))+1) - len(@start)-1);
END;
its look like this but need to declare a text to search
DECLARE @a VARCHAR(MAX) = 'All I knew was that the dog had been very bad and required harsh punishment immediately regardless of what anyone else thought.'
SELECT dbo.str_between(@a, 'the dog', 'immediately')
-- Yields' had been very bad and required harsh punishment '
how to translate to SQL orcl and extract data from table with column 'examplecolum' not delcared varchar like above and add a where clausule to it its possible?