Subject Re: [firebird-support] Get the value of generated primary key after an insert
Author Adriano
Helen (& ohers),
thank you for your help !

>Firebird 2 has an enhanced syntax available to return the value[s] of
>one or more columns from an INSERT statement. See the release notes, pp 35-6.

I'm trying to use the new options offers by 2.x version
query = "INSERT ..... "
Set rs = cn.Execute(query, , adCmdText)
' Then i'd like to retreive the value of my IDPratica (PK and first
field of my table PRATICHE)
Dim counter as integer
query = "SELECT RDB$GET_CONTEXT ('USER_TRANSACTION', 'IDPRATICA') AS
MyVar FROM RDB$DATABASE"
Set rs = cn.Execute(query, , adCmdText)
Counter = rs!MyVar
MsgBox Counter

But i receive a Null

Why ?
Adriano