SQLite3 retrieve id value always [] (nill)


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.

Hello again,

forget it :slight_smile:

I had wrong named variables :stuck_out_tongue:

sorry & byeez

On 25 Αυγ 2012, at 17:42 , Panagiotis A. [email protected]

The wise man said: “Never argue with an idiot, he brings you down to his level
and beat you with experience.”

Panagiotis A.