[V4Rb] VDatabase.LastInsertedRecID

Charles Yeomans yeomans at desuetude.com
Sat Oct 15 17:56:46 CDT 2005


On Oct 15, 2005, at 5:08 PM, Ivan Smahin wrote:

> Hello Charles,
>
> Saturday, October 15, 2005, 11:55:45 PM, you wrote:
>
>
> CY> On Oct 15, 2005, at 4:49 PM, Ivan Smahin wrote:
>
>>> Hello Charles,
>>>
>>> Saturday, October 15, 2005, 11:38:46 PM, you wrote:
>>>
>>> CY> Shouldn't VDatabase.LastInsertedRecID properly be
>>> CY> VTable.LastInsertedRecID?
>>>
>>> No. It's database property.
>>> It  means "last inserted RecID in any table of the current database 
>>> by
>>> current user".
>
> CY> Since a recID is a property of a record in a table, it seems to me 
> that
> CY> it should be a VTable property.  Why is it a VDatabase property?
>
> Do you really need the last inserted recID for each table?

I do, because I've been using it since Valentina 1.x with cursors.
>
> You may use something like this:
> SQLExecute( "insert into t1 ..." )
> SQLExecute(    "    insert    into   t2   (ptr_to_t1_Field)   values(  
>  "   +
> VDatabase.LastInsertedRecID + ")" )

I suppose, but I am curious about the question of design; a recID is a 
property of a record and a table, so it seems to me that VTable is the 
appropriate place for such a property.

--------------
Charles Yeomans



More information about the Valentina mailing list