mariano/node-db-oracle — Issue #23: Get last insert id via a returning statement
Author: joeferner
Created: 2011-12-16 22:48:34+00:00
State: open

I'm working on an ORM framework for node.js (https://github.com/nearinfinity/node-persist/) and I need a way to get the last inserted id. I have a table Person with columns id, name, age. The id column is associated with a sequence via a before insert trigger. I would like to get the id out when I execute the following sequence.

```
INSERT INTO Person (name, age) VALUES ('bob', 23) RETURNING id INTO ?
```

I would love to use your oracle driver but it doesn't look like there is any way to bind out parameters via the execute command.

I have a branch here: https://github.com/nearinfinity/node-persist/tree/db-oracle which is the start of incorporating your driver but if you run the nodeunit tests on select.js you will see I cannot get the id column back out.