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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Proposal - add the SUBSTRING alias for the SUBSTR function

iwisNov 24 2020 — edited Apr 15 2021

Hi!
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.
Particularly, I propose to add the SUBSTRING alias for the SUBSTR function.
Explanation: This is the current syntax of the SUBSTR[ING] functions in ANSI standard and in different RDBMS:

ANSI standard:      SUBSTRING   (s FROM start [FOR length])
PostgreSQL & MySQL: SUBSTR[ING] (s, start [,length])
Oracle & SQLite:    SUBSTR      (s, start [,length])
SQL Server:         SUBSTRING   (s, start  ,length )

To unify the syntax, I propose to add the SUBSTRING alias to the SUBSTR function in Oracle. SQLite already will support the SUBSTRING alias from the 3.34 version. If Oracle does the same, we will be able to use the SUBSTRING(s, start, length) syntax in all above-mentioned RDBMS. This will make the SQL Server syntax compatible with all major RDBMS. Hopefully this would be another step to help C# programmers switch from SQL Server to other databases. I think it is worth to think about it, especially after the latest release of the .NET 5 framework, which unifies the old .NET Framework and .NET Core, into the single multi-platform framework able to be run on Windows and Linux.
I also proposed this change: https://community.oracle.com/tech/developers/discussion/4477917/proposal-add-an-optional-argument-c-after-a-comma-in-the-trim-s-function.
The changes proposed by me for other RDBMS are listed here: https://github.com/iwis/SQL-notes/blob/master/Functions_proposed_changes.md

Comments

Luís Gustavo Lira

Hi,
I understand that it would be more apropriated if you use the "New idea" category instead of a "Ask a Question" category.
So the people can vote and eventually Oracle can implement you idea.

iwis

Thanks. I am adding the proposal as an idea here: https://community.oracle.com/tech/developers/discussion/4479149/add-the-substring-alias-for-the-substr-function/p1?new=1
I haven't add it before, because the "Idea" category had no posts, and I thought it isn't used.

User_CO64G

Trust the best home inspection company in Hamburg. House N Home Inspection provides the professional and certified home inspectors for your next home, condo, or building.

1 - 3

Post Details

Added on Nov 24 2020
3 comments
259 views