[asterisk-dev] func_odbc: Get the primary key for inserted row?
Johan Wilfer
lists at jttech.se
Thu Jul 21 04:23:17 CDT 2011
On 2011-07-20 22:02, Kevin P. Fleming wrote:
> On 07/20/2011 12:17 PM, Tilghman Lesher wrote:
>
>> I do not. Keep in mind that a database keeping an autogenerated row
>> ID is
>> pretty specific to MySQL (although as you noted, PostgreSQL does it,
>> too,
>> now). ODBC is an older standard that tends to match with
>> capabilities in
>> MS SQL Server, Sybase, Oracle, and DB2. Therefore, I'd be surprised to
>> learn that ODBC has such a concept.
>
> The way I've seen this done in the past (way past, like when I was an
> Oracle user) was that the INSERT statement itself would return a
> resultset, containing the generated IDs from the rows that were inserted.
>
Yes, that's a very good way to handle it. I've taken this kind of
functionality for granted when as it exists in one form or another in
most database extensions or abstractors I have used.
--
Med vänlig hälsning
Johan Wilfer email: johan at jttech.se
JT Tech | Utvecklare webb: http://jttech.se
direkt: +46 31 380 91 01 support: +46 31 380 91 00
More information about the asterisk-dev
mailing list