Traversing and Loading from an OID
Ruslan Zasukhin
sunshine at public.kherson.ua
Fri Feb 3 12:15:15 CST 2006
On 2/3/06 11:19 AM, "Philip Mötteli" <philip.moetteli at econophone.ch> wrote:
>>> Lets say, I have an OID and an I_Database (and a table name). What
>>> would I have to do, if I want to load the associated record in the db
>>> (using VSDK C++)?
>>
>> MAY BE there I sense add new function
>>
>> I_Table_Ptr I_Database::GoToRecord( OID )
>>
>> Which will do this job ?
>
> Yes, I think, it would make sense to offer this function.
> Which leads me to the next question: Are you sure, that there must be
> an "I_Table_Ptr" returned? Shouldn't it be some kind of a record?
> How do I actually load the (serialized) data of this record from the
> client?
As I see it:
* this is function of Database class
* this function can jump to any table of database right?
this is why it must return I_Table_Ptr -- found table
* and in found table it set CURRENT record to be RecID from OID.
pTable->put_RecID( recid );
So
I_Table_Ptr pTable = pdb->GoToRecord( OID );
// pTable already have load required record
// so you can read values:
for( I ){
pTable->get_Field(i)->get_Value()->get_String()
}
Btw, you can make this function self for now as extern algorithm to
I_Database interface:
I_Table_Ptr GoToRecord( I_Database_Ptr indb, OID inValue )
{
}
> I've found some pointing functions:
>
> virtual bool put_RecID( REC_ID inRecID ) = 0;
> virtual bool put_OID( OID inOID ) = 0;
This is in I_Table ?
But then this put_ID() use only RecID from OID,
Because you already know table. This is partial case only.
> But, after having pointed something in the I_Table, I need to
> actually load it to some local cache. How would I do that?
No. you do not load anything manually!
After put_RecID( 10 ) Valentina already have load this record into fields.
You can just read values of fields.
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
More information about the Valentina
mailing list