Search notes:

Oracle SQL function: SUBSTR

substr has to mandatory and one optional parameter:
substr( text , position )
substr( text , position , length )

Two parameters

With two parameters, substr returns the portion of text from character position through the end of text.
select
   substr(
      '1234567890', -- Text
       5            -- Start position
   )
from
   dual;
--
-- 567890
Github repository Oracle-Patterns, path: /SQL/functions/text/substr/two-parameters.sql

Three parameters

The optional third parameter is used to limit the length of the returned string:
select
   substr(
      '1234567890', -- Text
       5          , -- Start position
       3            -- Length
   )
from
   dual;
--
-- 567
Github repository Oracle-Patterns, path: /SQL/functions/text/substr/three-parameters.sql

Test with CLOBS longer than 32K

create table tq84_substr_test (
   clb clob
);

begin
   insert into tq84_substr_test values ('');

   for c in ascii('a') .. ascii('z') loop
      update
         tq84_substr_test
      set
         clb = clb || lpad(chr(c), 4000, chr(c));
    end loop;
end;
/

select
   26*4000 - length(clb) -- 0
from
   tq84_substr_test;

select
   substr(clb, 25*4000, 2) -- yz
from
   tq84_substr_test;

drop   table tq84_substr_test;

Variants

substr comes in five variants:

See also

regexp_substr is the regular expression version of substr.
dbms_lob.substr
Functions related to text and strings
The SQL Server's function substring.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1738292981, '3.137.185.16', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/SQL/functions/text/substr/index(118): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78