Skip to Main Content
Feature Request FR-4599
Product Area SQL Workshop
Status CLOSED

1 Voters

Quick SQL syntax for lookup table values

amiles Public
· Aug 11 2025

Idea Summary
Add a Quick SQL shorthand syntax to explicitly create lookup tables with a predefined set of values. This would allow both the table structure and its fixed data to be defined in the same Quick SQL script, without needing separate SQL insert statements.

Use Case
When developing a new application schema in APEX, it’s common to define lookup tables for enumerations like statuses, categories, or priority levels.

Quick SQL currently supports /insert and /values to generate random sample data, but there’s no way to specify fixed, curated values inline.

This forces developers to split the workflow: define the lookup table in Quick SQL, then write separate manual INSERT statements.

In collaborative schema design sessions with subject matter experts, it would be faster and clearer if the agreed-upon lookup values could be visible directly in the Quick SQL script.

Preferred Solution
Introduce a directive such as /fixed or /enum in Quick SQL that:

1. Optionally marks the table as a lookup table.

2. Generates INSERT statements for the exact values provided.

Example Syntax:

statuses /lookup
  status_name vc50
  /fixed Planned
  /fixed In Progress
  /fixed Complete
  /fixed On Hold

Generated SQL:

CREATE TABLE statuses (
  status_id NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
  status_name VARCHAR2(50) NOT NULL UNIQUE
);
INSERT INTO statuses (status_name) VALUES ('Planned');
INSERT INTO statuses (status_name) VALUES ('In Progress');
INSERT INTO statuses (status_name) VALUES ('Complete');
INSERT INTO statuses (status_name) VALUES ('On Hold');

Benefits:

Keeps schema definition and seed data in one place.

Improves collaboration with SMEs during schema workshops.

Speeds up prototyping and testing by providing realistic enumerations immediately.

We reviewed this idea carefully and came to the conclusion that it does not constitute an appropriate APEX feature request.

Comments

Comments

  • jayson hanes Admin OP 8 months ago

    Hi - QuickSQL is no longer part of APEX - it is maintained by the Oracle DBtools team, and you can submit issues here: https://github.com/oracle/quicksql/issues

  • amiles OP 8 months ago

    Thanks Jason, issue posted here…

    https://github.com/oracle/quicksql/issues/83