Skip to content

Commit 4eb0193

Browse files
committed
Support # and $ in PL/SQL named parameters
Fixes #822
1 parent ac92853 commit 4eb0193

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/languages/plsql/plsql.formatter.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ export const plsql: DialectOptions = {
107107
identChars: { rest: '$#' },
108108
variableTypes: [{ regex: '&{1,2}[A-Za-z][A-Za-z0-9_$#]*' }],
109109
paramTypes: { numbered: [':'], named: [':'] },
110-
paramChars: {}, // Empty object used on purpose to not allow $ and # chars as specified in identChars
111110
operators: [
112111
'**',
113112
':=',

test/plsql.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,13 @@ describe('PlSqlFormatter', () => {
8484
`);
8585
});
8686

87-
// Parameters don't allow the same characters as identifiers
88-
it('does not support #, $ in named parameters', () => {
89-
expect(() => format('SELECT :col$foo')).toThrowError(`Parse error: Unexpected "$foo"`);
90-
91-
expect(() => format('SELECT :col#foo')).toThrowError(`Parse error: Unexpected "#foo"`);
87+
// Issue #822
88+
it('supports #, $ in named parameters', () => {
89+
expect(format('SELECT :col$foo, :col#foo')).toBe(dedent`
90+
SELECT
91+
:col$foo,
92+
:col#foo
93+
`);
9294
});
9395

9496
it('supports &name substitution variables', () => {

0 commit comments

Comments
 (0)