Substr Function Examples

Example PL/SQL query

select substr('Reports are ready', 9, 3) from dual;
Result: 'are'
select substr('Reports are ready', 9) from dual;
Result: 'are ready'
select substr('OracleDatabase10G', 1, 6) from dual;
Result: 'Oracle'
select substr('OracleDatabase10G', -11, 8) from dual;
Result: 'Database'
select substr('OracleDatabase10G', 15, 3) from dual;
Result: '10G'