File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/select Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -4619,15 +4619,16 @@ JdbcNamedParameter JdbcNamedParameter() : {
46194619}
46204620
46214621OracleNamedFunctionParameter OracleNamedFunctionParameter() : {
4622- String name;
4622+ Token token = null;
4623+ String name = null;
46234624 Expression expression;
46244625}
46254626{
4626- name=RelObjectNameExt2()
4627+ ( name=RelObjectNameExt2() | token=<K_OUTER> )
46274628 <K_ORACLE_NAMED_PARAMETER_ASSIGNMENT>
46284629 expression=Expression()
46294630 {
4630- return new OracleNamedFunctionParameter(name, expression);
4631+ return new OracleNamedFunctionParameter(name != null ? name : token.image , expression);
46314632 }
46324633}
46334634
Original file line number Diff line number Diff line change @@ -31,4 +31,20 @@ void testLateralFlat() throws JSQLParserException {
3131 TestUtils .assertSqlCanBeParsedAndDeparsed (sqlStr , true );
3232 }
3333
34+ /**
35+ * The SQL keyword "OUTER" is a valid parameter name for Snowflake's FLATTEN table function.
36+ */
37+ @ Test
38+ void testTableFunctionWithNamedParameterWhereNameIsOuterKeyword () throws JSQLParserException {
39+ String sqlStr =
40+ "INSERT INTO db.schema.target\n " +
41+ " (Name, FriendParent)\n " +
42+ " SELECT\n " +
43+ " i.DATA_VALUE:Name AS Name,\n " +
44+ " f1.Value:Parent:Name AS FriendParent\n " +
45+ " FROM\n " +
46+ " db.schema.source AS i,\n " +
47+ " lateral flatten(input => i.DATA_VALUE:Friends, outer => true) AS f1;" ;
48+ TestUtils .assertSqlCanBeParsedAndDeparsed (sqlStr , true );
49+ }
3450}
You can’t perform that action at this time.
0 commit comments