Skip to content

Oracle SQL Export Generates Incorrect / Incomplete SQL (Beta Feature Bug) #698

@Kundan-CR7

Description

@Kundan-CR7

Describe the bug
The Oracle SQL Export feature (shown as "Oracle (Beta)" in the Export menu) generates incomplete or incorrect Oracle SQL. Several schema elements—such as datatypes, default values, enums, and constraints—are not exported using valid Oracle syntax, causing errors when running the generated SQL in an Oracle database (e.g., ORA-00902, ORA-00904, ORA-00942).

To Reproduce
Steps to reproduce:

  1. Open the DrawDB editor
  2. Create a table with VARCHAR fields, numeric fields, default values, or foreign keys
  3. Go to File → Export SQL → Oracle (Beta)
  4. Run the exported SQL in an Oracle database or online Oracle-compatible compiler
  5. Oracle reports syntax errors or invalid/unsupported datatypes

Expected behavior
The exported SQL should follow Oracle-specific syntax:

  • Use correct Oracle datatypes (VARCHAR2, NUMBER, CLOB, DATE, BINARY_DOUBLE, etc.)
  • Correctly export default values (including functions like SYSDATE or SYSTIMESTAMP)
  • Generate valid PRIMARY KEY and FOREIGN KEY constraints
  • Use Oracle-safe identity/auto-increment syntax
  • Convert ENUM fields into CHECK constraints (since Oracle does not support ENUM)
  • Avoid DOMAIN definitions (unsupported in Oracle)
  • Avoid non-Oracle or cross-dialect SQL keywords

Instead, the current output mixes generic SQL, MySQL, and PostgreSQL-style syntax, resulting in invalid Oracle statements.

Desktop (please complete the following information):

  • OS: macOS / Windows / Linux
  • Browser: Chrome / Safari / Firefox
  • Version: Latest DrawDB version

Additional context
This issue is related to incomplete logic in:
src/utils/exportSQL/oraclesql.js

I am opening this issue to help improve the Oracle export feature and I am willing to work on a PR to fix these problems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions