[Gambas-user] Connection.Create and .Index

tobias tobiasboe1 at ...20...
Mon Nov 29 21:02:21 CET 2010


Benoît Minisini schrieb:
>> hi,
>>
>> i'm confused about the output i get from:
>>
>> PUBLIC SUB test()
>>
>>    DIM hResult AS Result
>>
>>    'hConnection is an established Connection, with existing Table
>> "test", Fields "id", db.Serial Primary Key, "name" db.String
>>    hResult = hConnection.Create("test")
>>    PRINT hResult.Index
>>    hResult["name"] = "Aaron"
>>    hResult.Update()
>>    PRINT hResult.Index
>>    hResult["name"] = "Zacharias"
>>    hResult.Update()
>>
>> END
>>
>> i get in console:
>> 0
>> 0
>>
>> but i thought the second PRINTed Index should be 1? the records are fine
>> but with both indizes 0 shouldn't the first be overwritten with
>> "Zacharias" or is there another internal pointer to specify the record??
>>
>> regards,
>> tobi
>>
> 
> In creation mode there is only one record in the Result object, the record 
> that will be created. So Result.Index always returns 0.
> 
> Regards,
> 
oh... of course! this makes sense!
and for general unterstanding, i can say that an index in a result is 
some kind of linked to a position in the database so that the driver, or 
whatever does this, knows, where to write the record in the result to in 
the real database?




More information about the User mailing list