Table of Contents
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Table of contents
Virtual columns in DBeaver let you display calculated values in query results without changing the underlying database schema. They use an expression language based on the Apache Commons JEXL engine, which supports JavaScript-like syntax, functions, and variables. Expressions are evaluated in real time when you view data.
Note
: Virtual columns exist only inside DBeaver and are not saved in the database.
How to use
You can access the settings for configuring virtual columns through two different methods:
-
- Navigate to the Properties Editor.
- Select the Virtual tab from the Tabbed editors.
- In the Virtual columns section, click Add
- Enter a name and an expression for the new column
-
- Right-click inside the Data Editor
- Select Logical structure -> Add virtual column
- Enter a name and an expression
Virtual columns are shown alongside other columns in the Data Editor. Their values are calculated dynamically based on your expression.
Functions
Functions are grouped into namespaces. You can refer to the functions in the namespaces as variables -
nsName.functionName(parameters).
math
You can access all math functions as math.function(parameters).
See the full list of supported math functions in the Oracle documentation.
geo
| Function | Parameters | Description |
|---|---|---|
| wktPoint | (longitude, latitude) |
Produces WKT (geometry) point out of two coordinates. Default SRID is 4326. |
| wktPoint | (longitude, latitude, srid) |
Produces WKT (geometry) point out of two coordinates and SRID |
content
If you have JSON or XML columns in your table, you can add a virtual column with an expression for these columns.
Use content.json(<columnName>)[parameter1][parameter2] pattern to create expression for JSON column.
Example:
content.json(column1)['glossary']['GlossDiv']['title']
Use content.xml(columnName, "expression") or content.xml(columnName, "returnType", "expression") patterns to create
an expression for an XML column. The quotation is important for parsing processes. The "expression" parameter is
an XPath query used to select data from the XML.
XML expression can return types:
stringnumberbooleannodenodeset
All these types can be used without quotes in the return type parameter. content.xml(columnName, "expression") returns string by default.
Example:
content.xml(column1, "nodeset", "/Employees/Employee[gender='Female']/name/text()")
row
row is a map of all columns in the current row, where keys are column names and values are column values.
Use quotes or backticks for names with spaces, punctuation, or digits.
Example:
row['First Name'] + ' ' + row['Last Name']
You can also refer to columns without row if their names are simple (no spaces or special characters).
Example:
FirstName + ' ' + LastName
table
table contains metadata about the current table. Supports:
nameschemacontainer
Example:
table.name
Editing virtual columns
To modify or delete an existing virtual column:
-
Access the settings for configuring virtual columns.
-
Select the column you want to change.
- To edit, click Edit and update the name or expression.
- To delete, click Remove.
Note
: Changes apply only in DBeaver and don’t affect the database schema.
Defining virtual keys
In cases where a table lacks a unique key, DBeaver provides the functionality to define a virtual key. This feature allows the creation of a custom set of columns that act as a unique identifier for table rows, facilitating the saving of changes in the absence of traditional unique constraints.
Refer to the Virtual Keys documentation for additional details on configuring and using virtual keys.
DBeaver Documentation
- Getting started
- DBeaver configuration
- Security
- Connection settings
- Databases support
- Classic
- Cloud
- Embedded
- File drivers
- Graph
- Database Navigator
- Data Editor
- SQL Editor
- Entity relation diagrams (ERD)
- Cloud services
- AI Assistant
- Data transfer and schema compare
- Task management
- Integrated tools
- Administration
- DBeaver Editions
- Standalone
- Cloud-hosted
- FAQ
- Development

