Dameng Database SQL Parser for Java
General SQL Parser (GSP) parses Dameng Database with a dedicated, hand-tuned grammar — full AST access, offline syntax validation, formatting, rewriting, and column-level data lineage, including complete procedural SQL support. One commercial SDK — Dameng Database is available in the Java edition.
Dameng Database SQL that GSP parses
CREATE OR REPLACE CLASS employee_t NOT FINAL IS
name VARCHAR2(100);
MEMBER FUNCTION get_info RETURN VARCHAR2;
END; Parse it in Java
import gudusoft.gsqlparser.*;
TGSqlParser parser = new TGSqlParser(EDbVendor.dbvdameng);
parser.sqltext = sql; // the Dameng Database SQL above
if (parser.parse() == 0) {
System.out.println(parser.sqlstatements.size() + " statement(s) parsed");
} else {
System.out.println(parser.getErrormessage());
} Java edition only. The .NET library has no Dameng Database grammar, so this dialect cannot be parsed from C# or VB.NET. See the .NET SQL Parser SDK for the dialects it does cover.
What GSP handles in Dameng Database
- CREATE OR REPLACE PACKAGE specs and bodies
- Dameng-proprietary CREATE CLASS and CREATE HUGE TABLE
- CREATE TYPE AS OBJECT with TYPE BODY methods, VARRAY and TABLE OF collections
- Flashback queries — WHEN TIMESTAMP, AS OF LSN, VERSIONS BETWEEN LSN
- Materialized views and MV logs, including ON PREBUILT TABLE and query-rewrite toggles
- External routines via CREATE LIBRARY and AS LANGUAGE C/CS bodies
- Dameng lexical rules: // comments, Q-quoted strings, 0x hex literals
- Procedural SQL: Dameng PL/SQL — packages, procedures, functions, object type bodies, every trigger form (DML, INSTEAD OF, DDL/system-event, TIMER), and anonymous DECLARE blocks
Beyond parsing, the same AST powers table/column extraction, validation, formatting, and column-level lineage for Dameng Database.
Recent Dameng Database parser updates
- 2026-06-15 [Dameng] Support CREATE [OR REPLACE] PROCEDURE
- 2026-06-11 [Dameng] Fix Q-quote lexing and stale keyword values
- 2026-04-14 [Dameng] Support CREATE [OR REPLACE] PACKAGE BODY
Full history in the release notes.
Dameng Database resources
- Java quick start — Maven/Gradle setup and first parse
Common questions
Does GSP parse Dameng Database stored procedures and procedural SQL?
Yes. GSP parses Dameng PL/SQL — packages, procedures, functions, object type bodies, every trigger form (DML, INSTEAD OF, DDL/system-event, TIMER), and anonymous DECLARE blocks into a full AST — procedure bodies become real statement trees you can traverse, not opaque text blocks. This is what makes lineage and impact analysis work inside procedural code.
Do I need a live Dameng Database database connection to validate SQL?
No. GSP validates Dameng Database syntax completely offline. You get error line and column positions, the offending token, and a hint — with no server, driver, or credentials involved.
Can I use the Dameng Database parser from C# / .NET?
Not currently. Dameng Database is a Java-edition dialect — the .NET library ships 15 dedicated grammars and Dameng Database is not one of them, so there is no C# code path for it. Everything else on this page describes the Java SDK. If you need Dameng Database in .NET, email info@sqlparser.com; customer demand is how dialects get prioritized for the .NET port.
Can GSP extract column-level lineage from Dameng Database SQL?
Yes. The built-in DataFlowAnalyzer produces column-level lineage, impact analysis, and call graphs from Dameng Database scripts — it is the engine behind Gudu SQLFlow and the lineage integrations for DataHub and OpenMetadata.