Hello,
I want to add an entry to an SQLite3 table and then retrieve the ‘id’
value which is the value of the “primary key” define in the table as:
“id integer primary key”.
It’s an unique integer (id) like ‘1, 2, 3…’ which defines the entry.
I’d like to use this entry to identify this entry in order to use it as
a link to other tables.
Here is my code: https://gist.github.com/3466568
However the resulting value is always “[]”. It returns an empty array.
Shouldn’t it return a value instead? It’s like if the command is execute
before the begin/rescue statement. I can clearly see the entry using
SQLite3 cli.
Another approach would be to use the ‘select’ statement outside the
function. This will probably work better. But why does this happen
anyway? Is there a way to get the index_id at this point?
Best regards
Panagiotis A.