Returning in sql

24 views
Skip to first unread message

Michel Le Clézio

unread,
Oct 7, 2025, 3:54:13 PM (2 days ago) Oct 7
to firebird...@googlegroups.com
Hello, does Firebird 5 support returning in Sql ? I've try but don't succeed... I've got a SSL like this :
insert ID into ROLING (Exer) Value (:Exer) Returning ID; 

I use parameter.  Parabyname(Exer).Asinteger := 27;
(Using uniquely from devart)...
We
And it return me : SQL statement doesn't return rows...


May be it's normal if returning is not supported...
If supported, what's wrong with my SQL ?

Big thank you in advance for any help.

With best regards,
Mikey.

Tomasz Tyrakowski

unread,
Oct 7, 2025, 5:29:56 PM (2 days ago) Oct 7
to firebird...@googlegroups.com
On 7.10.2025 at 21:53, Michel Le Clézio wrote:
> Hello, does Firebird 5 support returning in Sql ? I've try but don't
> succeed... I've got a SSL like this :
> insert ID into ROLING (Exer) Value (:Exer) Returning ID;
> [...]
> If supported, what's wrong with my SQL ?
insert into ROLING (Exer) Value (:Exer) Returning ID;

regards
Tomasz

Dimitry Sibiryakov

unread,
Oct 7, 2025, 5:29:57 PM (2 days ago) Oct 7
to firebird...@googlegroups.com
Michel Le Clézio wrote 07.10.2025 21:53:
> Hello, does Firebird 5 support returning in Sql ?

Yes, it does:
https://firebirdsql.org/file/documentation/chunk/en/refdocs/fblangref50/fblangref50-dml-insert.html#fblangref50-dml-insert-returning

--
WBR, SD.

Ertan Küçükoglu

unread,
Oct 8, 2025, 1:09:55 AM (yesterday) Oct 8
to firebird...@googlegroups.com
Since you are using Devart components;
- You should use TUniQuery and not TUniSQL
- You can still use TUniQuery.Execute
- You can read the value TUniQuery.ParamByName('RET_ID').AsInteger /AsLargeint etc.

TUniSQL does not return a dataset and that is the problem. TUniQuery does return a dataset.

Michel Le Clézio <mlcvis...@gmail.com>, 7 Eki 2025 Sal, 22:54 tarihinde şunu yazdı:
--
Support the ongoing development of Firebird! Consider donating to the Firebird Foundation and help ensure its future. Every contribution makes a difference. Learn more and donate here:
https://www.firebirdsql.org/donate
---
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/firebird-support/CAO%2BqP1Hjrj04vGUjDyhECh4eOqbUR3WQcL%3DPRSiULiXo0QO0Ow%40mail.gmail.com.

Mark Rotteveel

unread,
Oct 8, 2025, 4:09:48 AM (yesterday) Oct 8
to firebird...@googlegroups.com
On 08/10/2025 07:09, Ertan Küçükoglu wrote:
> Since you are using Devart components;
> - You should use TUniQuery and not TUniSQL
> - You can still use TUniQuery.Execute
> - You can read the value TUniQuery.ParamByName('RET_ID').AsInteger /
> AsLargeint etc.
>
> TUniSQL does not return a dataset and that is the problem. TUniQuery
> does return a dataset.

I'm not familiar with Delphi components, but an INSERT .. VALUES ...
RETURNING ... is still a singleton result, like an executable stored
procedure, not like a query (contrary to other DML operations with
RETURNING, which since Firebird 5 return a result set instead of a
single row).

Mark
--
Mark Rotteveel

Michel Le Clézio

unread,
Oct 8, 2025, 10:19:11 AM (yesterday) Oct 8
to firebird...@googlegroups.com
Hello ! big thank you for your responses. I've notice that, Returning is possible in the condition Mark explain....

With best regards,
Mikey.

--
Support the ongoing development of Firebird! Consider donating to the Firebird Foundation and help ensure its future. Every contribution makes a difference. Learn more and donate here:
https://www.firebirdsql.org/donate
---
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages