Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Implementing SUBSTRING and POSITION standard SQL string functions

iwisDec 31 2020 — edited Apr 15 2021

I compared string functions in 5 different RDBMS: PostgreSQL, MySQL, Oracle, SQL Server and SQLite, and also in the ANSI SQL Standard. There are large differences among different RDBMS, and I propose to reduce them a little bit.
The SQL Standard defines, among others, these functions operating on text strings:

SUBSTRING(s FROM start [FOR length])
POSITION(s2 IN s)

They are already implemented by PostgreSQL and MySQL. I propose to implement these 2 functions in Oracle as well. Currently, Oracle implements the following functions that work identically to the SQL Standard:

SUBSTR(s, start [,length])
INSTR(s, s2)

For more information about comparing implementations of the scalar functions, click here: https://github.com/iwis/SQL-notes/blob/master/Functions.txt

Comments

Processing

Post Details

Added on Dec 31 2020
1 comment
536 views