You can return the value in a batch of sql commands like this:

nStat = SQLEXEC(nHandle,[insert into junk (f1) values ('abc');select
@@identity])

The identity field value will be returned in cursor named sqlresult or you
can name the result set like this:

nStat = SQLEXEC(nHandle,[insert into junk (f1) values ('abc');select
@@identity],"myidentity")

Fred


On Fri, Apr 10, 2009 at 5:48 PM, Rafael Copquin <rcopq...@ciudad.com.ar>wrote:

> How does one obtain the last identity value generated when inserting into a
> SQL table from VFP, in the same way one uses the VFP getautoincvalue
> function?
>
> Rafael Copquin
>
>
> --- StripMime Report -- processed MIME parts ---
> multipart/alternative
>  text/plain (text body -- kept)
>  text/html
> ---
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/3392e7100904101933w3a316776y7b82f4b700270...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to