Skip to content

Commit c993c98

Browse files
lbovetKvanTTT
authored andcommitted
[PlSql] Fix JSON_OBJECT to allow FORMAT JSON for all entry types
1 parent 897eedb commit c993c98

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

sql/plsql/PlSqlParser.g4

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6555,9 +6555,10 @@ json_object_content
65556555
;
65566556

65576557
json_object_entry
6558-
: KEY? expression (VALUE | IS)? expression
6559-
| expression ':' expression (FORMAT JSON)?
6560-
| identifier
6558+
: (KEY? expression (VALUE | IS)? expression
6559+
| expression ':' expression
6560+
| identifier
6561+
) (FORMAT JSON)?
65616562
;
65626563

65636564
json_table_clause

sql/plsql/examples/json_sql.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ ORDER BY d.department_id;
99

1010
SELECT JSON_OBJECT(KEY 'VALUE' VALUE COL), t.* FROM T t;
1111

12+
SELECT JSON_OBJECT(KEY 'VALUE' VALUE COL FORMAT JSON), t.* FROM T t;
13+
1214
SELECT JSON_ARRAY (
1315
JSON_OBJECT('percentage' VALUE .50),
1416
JSON_ARRAY(1,2,3),

0 commit comments

Comments
 (0)