Object Pointer Info

Steve Kump lists at jskump.com
Fri Mar 7 10:59:50 CST 2003


Hi Ruslan,

I read the document and found the paragraph you were talking about.

So, if I have 2 tables, Dealer and Listings, I create the ObjectPtr in the
Listings table to point to RecID of the Dealer record I want to relate it
to. This makes sense...when I add a new Listings records, I first get the
related Dealer record RecID, and add it to the ObjectPtr field in the
Listing record.

But here is my situation:

I want to import several hundred records from a text file into the Listings
table. How do I create the relationship for these records now? Do I have to
update each one of them with the RecID for the dealer?

Thanks,
Steve
On 3/7/03 10:33 AM, "Ruslan Zasukhin" <sunshine at public.kherson.ua> wrote:

> on 3/7/03 8:13 PM, Steve Kump at lists at jskump.com wrote:
> 
>> Hi List,
>> 
>> I am a new Valentina user, still trying the product out. So far, it seems
>> great. I'm using AppleScript and FaceSpan.
>> 
>> A few questions - I'm trying to create a relationship between two tables:
>> 
>> Dealers and Listings.
>> 
>> Each Dealer can have several Listings. I use the DealerID field as the
>> ObjectPtr. My question is this:
>> 
>> Do I have to create Object Pointers in BOTH tables?
> 
> No, only in MANY table, I.e. Listings in your case
> 
>> So, the Dealer ID field in the Dealer table points to the Dealer ID field in
>> the Listings table AND the DealerID field in the Listings table points to the
>> DealerID field in the Dealer table?
> 
> Steve, please read ValentinaSQL.pdf
> One of last paragraphs that describe RDB linking and ObjectPtr linking and
> how they differ.
> 
> If you use ObjectPtr field in MANY table, then ONE table even do not need ID
> field.
> 
>> I think I only have to create the pointer in the Listings table and point it
>> to the Dealer table. This creates the 1 to many relationship I am looking
>> for.
> 
> YES! correct.
> 
>> When I create the pointer in the Dealer table and point to the Listings
>> table, it creates a 1 to 1 relationship.
> 
> You do not need this second ObjectPtr field!
> 
> IF you have some RecID of record in dealer table, and you want find related
> to it records in table Listings, you need simply
> 
>   select * from Listings where Ptr = SomeRecID
> 
>> Further, no matter how I create the relationship, when I choose "Show
>> Linked" from the user interface and specify the Object B as [DealerID]Dealer
>> or [DealerID]:Listings from the pull down, it doesn't show the related
>> records. I clicked the Dealer ID column sort and then it showed 1 dealer,
>> but never the Dealer that should be related to the listing record based on
>> the Dealer ID.
> 
> This means that records are not correctly linked by ObjectPtr field.
> 
> What and how is stored in values of your ObjectPtr field?
> Here must be stored RecIDs of pointed records.
> 
>> To make a long story short, what is the correct way to create the pointer in
>> such a situation?



More information about the Valentina mailing list