Skip to content

Conversation

artemsnisarenko
Copy link

Yet another pull request for ANSI SQL-92 substring.

<character substring function> ::=
              SUBSTRING <left paren> <character value expression> FROM <start position>
                          [ FOR <string length> ] <right paren>

http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 86.828% when pulling e9c4f3f on artemsnisarenko:substring-from into 21e8bc4 on JSQLParser:master.

@coveralls
Copy link

coveralls commented Feb 1, 2018

Coverage Status

Coverage increased (+0.1%) to 87.16% when pulling 0863645 on artemsnisarenko:substring-from into feaeaeb on JSQLParser:master.

@wumpz
Copy link
Member

wumpz commented Feb 1, 2018

Isn't the a from b syntax used as parameter for other functions as well? Wouldn't it be better to improve the function rule to accept this kind of parameter?

@artemsnisarenko
Copy link
Author

In SQL:2003 there are four functions that have a from sub-expression. Besides substring they are overlay, trim and extract. The last one already has a dedicated expression class. I'm not sure about merits of either approach but changing the function rule would be inconsistent with what's already there.

@wumpz
Copy link
Member

wumpz commented Feb 5, 2018

Oracle has extract as well (#579).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants