# \#sql

**URL:** https://community.developer.atlassian.com/tag/sql/718.md

[Latest](https://community.developer.atlassian.com/latest.md) · [Categories](https://community.developer.atlassian.com/categories.md) · [Tags](https://community.developer.atlassian.com/tags.md)

---

## [ERROR 400 INVALID\_CAPABILITY when executing sql requests (did work before hand, nothing changed but now its broken)](https://community.developer.atlassian.com/t/error-400-invalid-capability-when-executing-sql-requests-did-work-before-hand-nothing-changed-but-now-its-broken/98392)

<div class="topic-metadata">

**Author:** [@SebastianRosenkranz](https://community.developer.atlassian.com/u/SebastianRosenkranz)\
**Replies:** 1\
**Last updated:** [January 15, 2026, 12:05pm UTC](https://community.developer.atlassian.com/t/error-400-invalid-capability-when-executing-sql-requests-did-work-before-hand-nothing-changed-but-now-its-broken/98392 "2026-01-15T12:05:25Z")

</div>

I get this error whenever I use forge-sql, but all the code did work 2 days ago, I just got the error when starting it up yesterday. So for example when I do this, I get the error down below. sql.prepare("SELECT \* FROM…

---

## [Forge SQL - Auto Increment recommendation](https://community.developer.atlassian.com/t/forge-sql-auto-increment-recommendation/92233)

<div class="topic-metadata">

**Author:** [@PeterMcNeil2](https://community.developer.atlassian.com/u/PeterMcNeil2)\
**Replies:** 5\
**Last updated:** [June 30, 2025, 1:46am UTC](https://community.developer.atlassian.com/t/forge-sql-auto-increment-recommendation/92233 "2025-06-30T01:46:31Z")

</div>

The doco for Forge SQL recommends: Avoid using AUTO INCREMENT fields in your tables, as Forge SQL is based on a distributed SQL database and sequences are not guaranteed to be globally unique. The statement that “seq…

---

## [How to get milliseconds of DATETIME or TIMESTAMP from @forge/sql](https://community.developer.atlassian.com/t/how-to-get-milliseconds-of-datetime-or-timestamp-from-forge-sql/92051)

<div class="topic-metadata">

**Author:** [@robertbrower](https://community.developer.atlassian.com/u/robertbrower)\
**Replies:** 2\
**Last updated:** [May 19, 2025, 6:33am UTC](https://community.developer.atlassian.com/t/how-to-get-milliseconds-of-datetime-or-timestamp-from-forge-sql/92051 "2025-05-19T06:33:08Z")

</div>

I create a table using a migration as per the docs https://developer.atlassian.com/platform/forge/storage-reference/sql-tutorial/ export const CREATE\_LOGS\_TABLE = CREATE TABLE IF NOT EXISTS Logs ( id INT PRIMARY KEY…

---

## [Can't get an SQL working with entityManager](https://community.developer.atlassian.com/t/cant-get-an-sql-working-with-entitymanager/59653)

<div class="topic-metadata">

**Author:** [@hugo](https://community.developer.atlassian.com/u/hugo)\
**Replies:** 3\
**Last updated:** [July 25, 2022, 5:14pm UTC](https://community.developer.atlassian.com/t/cant-get-an-sql-working-with-entitymanager/59653 "2022-07-25T17:14:01Z")

</div>

To update our apps for Confluence 8 & Hibernate 2 removal, we need to execute an SQL on migration tables. I am doing: Query query = entityManager.createQuery("SELECT " + ASSESSMENT\_STATUS\_COLUMN + " FROM " + MIG\_APP\_AS…

---

## [Help me to Join the output of following postgres database query](https://community.developer.atlassian.com/t/help-me-to-join-the-output-of-following-postgres-database-query/48369)

<div class="topic-metadata">

**Author:** [@SanjayDhandare1](https://community.developer.atlassian.com/u/SanjayDhandare1)\
**Replies:** 0\
**Last updated:** [May 27, 2021, 6:24pm UTC](https://community.developer.atlassian.com/t/help-me-to-join-the-output-of-following-postgres-database-query/48369 "2021-05-27T18:24:18Z")

</div>

I am interested to join the output of two queries out of that one return the last login details of users and second queries return role assign to users and I want this both result in one query. Can anyone help me to joi…

---

## [SQL Exception When Adding Comments](https://community.developer.atlassian.com/t/sql-exception-when-adding-comments/44047)

<div class="topic-metadata">

**Author:** [@ArdaKo](https://community.developer.atlassian.com/u/ArdaKo)\
**Replies:** 1\
**Last updated:** [January 7, 2021, 2:11pm UTC](https://community.developer.atlassian.com/t/sql-exception-when-adding-comments/44047 "2021-01-07T14:11:54Z")

</div>

Hi everyone, I’m trying to add threaded comments when pressing the reply button. I want to do that with Active Objects. When I press the button, it normally needs to write to my entity table named AO\_C21EEC\_THREADED\_COM…

---

## [How to create subquery in active object](https://community.developer.atlassian.com/t/how-to-create-subquery-in-active-object/39440)

<div class="topic-metadata">

**Author:** [@OleksiiSkachkov](https://community.developer.atlassian.com/u/OleksiiSkachkov)\
**Replies:** 3\
**Last updated:** [June 30, 2020, 3:29pm UTC](https://community.developer.atlassian.com/t/how-to-create-subquery-in-active-object/39440 "2020-06-30T15:29:39Z")

</div>

For example I have query on SQL: SELECT length FROM ( SELECT length, MIN(title) title FROM film GROUP BY length ) t ORDER BY title I want to create the same for Jira’s Active object: Query query = Query.select()…

---

## [Query Active Objects for statistical data or how to escape Active Object restrictions](https://community.developer.atlassian.com/t/query-active-objects-for-statistical-data-or-how-to-escape-active-object-restrictions/35176)

<div class="topic-metadata">

**Author:** [@stefan.glase](https://community.developer.atlassian.com/u/stefan.glase)\
**Replies:** 2\
**Last updated:** [January 27, 2020, 8:09am UTC](https://community.developer.atlassian.com/t/query-active-objects-for-statistical-data-or-how-to-escape-active-object-restrictions/35176 "2020-01-27T08:09:16Z")

</div>

When using Active Objects in a Jira plugin you have a limited amount of operations you can execute against the database. For example the count(\*) - methods only allow to return the result of the first row. More or less t…
