New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plsql] ParseException for CREATE TABLE #980

dvdtknsn opened this Issue Mar 16, 2018 · 2 comments


None yet
3 participants

dvdtknsn commented Mar 16, 2018

Please, prefix the report title with the language it applies to within brackets, such as [java] or [apex].
If not specific to a language, you can use [core].

Affects PMD Version:
Issue parsing a .sql file that has a CREATE TABLE definition
net.sourceforge.pmd.PMDException: Error while parsing D:\flOraGithubRepo\HR_WF\Database\HR\Tables\CUSTOMERS.sql
at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(
at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(
at Source)
at java.util.concurrent.Executors$ Source)
at Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$ Source)
at Source)
Caused by: net.sourceforge.pmd.lang.plsql.ast.ParseException: Encountered " "PRIMARY "" at line 5, column 27.
Was expecting one of:
"@" ...
"." ...
"," ...
")" ...
"%" ...
"NOT" ...
"NULL" ...

at net.sourceforge.pmd.lang.plsql.ast.PLSQLParser.generateParseException(
at net.sourceforge.pmd.lang.plsql.ast.PLSQLParser.jj_consume_token(
at net.sourceforge.pmd.lang.plsql.ast.PLSQLParser.Table(
at net.sourceforge.pmd.lang.plsql.ast.PLSQLParser.Input(
at net.sourceforge.pmd.lang.plsql.PLSQLParser.parse(
at net.sourceforge.pmd.SourceCodeProcessor.parse(
at net.sourceforge.pmd.SourceCodeProcessor.processSource(
at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(

Code Sample demonstrating the issue:
-- this is the customers.sql file:
CREATE TABLE customers
( customer_id number(10) NOT NULL,
customer_name varchar2(50) NOT NULL,
city varchar2(50),
CONSTRAINT customers_pk PRIMARY KEY (customer_id)

Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
Windows command line:
call Tools\pmd\bin\pmd -d "Database\HR" -l plsql -R pmd_ruleset.xml -f summaryhtml -r Artifacts\static_analysis_report.html


This comment has been minimized.

dvdtknsn commented Mar 17, 2018

Just found that possibly implies that this isn't supported. Either way, I'd expect it to skip what it can't understand rather than throwing an exception.

@jsotuyod jsotuyod added the a:bug label Mar 18, 2018


This comment has been minimized.


jsotuyod commented Mar 18, 2018

@dvdtknsn definitely. The parser shouldn't throw when processing valid PL/SQL.

@adangel adangel changed the title from [plsql] plsql.ast.ParseException for CREATE TABLE to [plsql] ParseException for CREATE TABLE Jul 15, 2018

adangel added a commit to adangel/pmd that referenced this issue Jul 15, 2018

adangel added a commit to adangel/pmd that referenced this issue Jul 15, 2018

@adangel adangel added the has:pr label Jul 15, 2018

@adangel adangel added this to the 6.6.0 milestone Jul 15, 2018

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