Skip to content

The SQL Editor

The editor in Data Collage is built around writing Oracle SQL against Fusion. It’s a modern code editor — syntax highlighting, autocomplete, multi-cursor — with extra help layered on top for the tables and functions you actually work with.

You can have multiple tabs open at once, side by side along the top of the editor area.

  • New tabCtrl+T, or the + at the end of the tab strip, or File → New Tab.
  • Switch between tabs by clicking them; close with the × on the tab.
  • Each tab keeps its own session state — SQL text, last result set, applied column formats, formula columns, hidden columns, column order, and bind variable values. Running a query in one tab doesn’t disturb any other.
  • Open tabs are remembered across app restarts — Data Collage restores the tab list, each tab’s SQL text, the active tab, the file path backing each tab (if any), and the connection it was using.
  • Session-only state is not restored after a restart — results, column formats, formula columns, hidden columns, column order, and bind values reset. To preserve all of that across restarts, save the tab as a Saved Analysis (.dcanalysis) — see §10.

SQL keywords, string literals, comments, and :bind variables each get distinct colors. The editor ships with a Dark theme and a Light theme — pick one in §14 — Settings.

A dropdown appears as you type, covering four categories:

  • SQL keywordsSELECT, JOIN, WHERE, and so on.
  • Fusion table names — type a few letters of a table name (e.g. ap_inv) and pick from the list. Tables shown come from the metadata bundled with Data Collage.
  • Column names — type alias. (the alias you used in your FROM clause) and the dropdown scopes to that table’s columns.
  • Oracle function signatures — type a function name and the dropdown shows its signature and a one-line description.

Autocomplete dropdown listing Fusion tables matching the typed prefix

Hover your mouse over a known Fusion table name and a tooltip shows its description.

Hover tooltip on a Fusion table showing its module and column count

Hover over an Oracle function and you’ll see its signature and description.

Hover tooltip on a Fusion table showing its module and column count

Standard Oracle SQL comment syntax works:

  • -- single-line comment
  • /* block comment */

Comments are stripped before the SQL is sent to Fusion — feel free to leave plenty in your saved analyses.

Data Collage decides what to execute based on the state of your editor when you hit Run. There are three Run modes, in priority order:

  1. Selection wins. If you have any non-empty text selected, that exact text is what runs. Use this to test a sub-query, a CTE in isolation, or one part of a larger script.
  2. Multi-statement at cursor. If the tab contains two or more SQL statements separated by ;, the editor runs the one your cursor is currently inside. A small hint above each statement reads “Statement N of M — Ctrl+Enter to run” so you can see which one will run.
  3. Whole tab. If neither of the above applies, the entire content of the tab is what runs.

These three are equivalent:

  • F5
  • Ctrl+Enter (while focus is in the editor)
  • The Run button on the toolbar

Use :name anywhere in your SQL to mark a value the user should supply at run time. For example:

SELECT *
FROM ap_invoices_all
WHERE invoice_date BETWEEN :p_from_date AND :p_to_date
AND invoice_num = :p_invoice_num

When you Run, a Bind variables dialog pops up listing each placeholder. Fill in the values and click Run.

Bind variables dialog with three placeholders — p_from_date, p_to_date, p_invoice_num — and sample values

A few helpful behaviors:

  • Values stay filled in per tab for the rest of your session — so re-running with different dates is fast.
  • The validator and Fusion never see the :name syntax — Data Collage substitutes the values before the SQL leaves your machine.

Bind values can also be saved as defaults into a .dcanalysis file — see §10 — Saved Analyses.

To pretty-print the SQL in the active tab — consistent keyword case, indentation, line breaks — use:

  • Shift+Alt+F, or
  • Edit → Format SQL in the menu bar

The formatting is in-place; your cursor stays where it was.

Short codes let you type a small prefix and expand it into a longer SQL snippet. Data Collage ships with a starter set:

TriggerExpands to
ssfSELECT * FROM
sfcSELECT COUNT(*) FROM
sfwSELECT * FROM \nWHERE
jlLEFT JOIN ON
jiINNER JOIN ON
nvlNVL(expr1, expr2)
decDECODE(expr, search1, result1, default)
cwCASE WHEN THEN ELSE END

To add your own (and to view, edit, or remove the bundled ones), open Help → Short codes…. Custom short codes are saved to your local profile and persist across sessions.

A SQL tab can be saved as a .sql file on disk — useful for sharing a raw query with a colleague who doesn’t have Data Collage, version-controlling your SQL, or simply backing up a working draft.

  • Ctrl+S — Save. If the tab is already backed by a file, this writes to that file. Otherwise it prompts for a location.
  • Ctrl+Shift+S — Save As. Always prompts for a location.
  • Ctrl+O — Open a .sql (or .txt) file from disk into a new tab.

Once a tab is backed by a file, the tab title shows the file name; subsequent Saves write back to the same path without prompting again.

If you want to save more than just the SQL — your applied formats, formula columns, hidden columns, column order, and bind defaults — use a Saved Analysis (.dcanalysis) instead. See §10.

ActionShortcut
Run queryF5 or Ctrl+Enter
Format SQLShift+Alt+F
SaveCtrl+S
Save AsCtrl+Shift+S
Open .sql fileCtrl+O
New tabCtrl+T
Toggle sidebarCtrl+B
Open SettingsCtrl+,