[Lazarus] Returning value from a Firebird (embedded) generator into Lazarus code

Gabor Boros gaborboros at yahoo.com
Sat Apr 25 17:37:35 CEST 2015


2015.04.25. 16:52 keltezéssel, brian írta:
>
> Retrieve a value generated by a Firebird generator (in other words, an
> autoincremented value stored within the database) and get that
> incremented value into a Pascal variable. The SQL code to increment
> the value in the Firebird database is
>
> SELECT (<generator>,<increment>) FROM RDB$DATABASE;
>
> but I'm struggling to find a way to retrieve that incremented value.
> Simply attaching a data source to the query returns zero rows when the
> SQL is executed. I'm wondering whether I need to use a dummy table and
> then use the generator to update a field, then retrieve the data with
> a separate query.

Hi,

Use RETURNING clause with INSERT or UPDATE is a better solution.

Gabor




More information about the Lazarus mailing list