ObjectPtr - What's the best way to create a new ObjectPtr link for two existing tables. Both have existing data.

Barry G. Sumpter BarrySum at BigPond.Net.AU
Sat Jun 9 15:43:35 CDT 2007


Hi all,

For my sample scenario:

I have a SoldInPostCode table with 100,000 records.
(I've sold 100,000 widgets.)
Each record has just a single field of a Postcode in it.
It is numeric.
And the max value is 99999.
The PostCode is NOT unique.

I have a PostCodeWithState table with all the PostCodes with their States.
(I want to know how many widgets were sold in each state)
99999 postcodes within 52 states.
There are two fields.
Each record has a single field of a Postcode in it.
It is numeric.
And the max value is 99999. 

Each record also has a single field of a State in it.
Lets say for now it is a string.
2 characters long.
And contains the 52 State abbreviations.  TX, OK, CA.

So the Left table has 100,000 Records.
I want to like to the right table that has 99,999 records.

For this scenario I want an ObjectPtr
So I've already created an ObjectPtr field: SoldPC_PCState.

To now link by actually populating the SoldPC_PCState ObjectPtr:

  Do I have to write code to do the following?: 
     1) Step thru each of the 100,000 SoldInPostCode records
     2) Find the corresponding Post Code in PostCodeWithState 
        (retrieving the PostCodeWithState.RecID)
     3) Update the  SoldInPostCode.SoldPC_PCState ObjectPtr with
PostCodeWithState.RecID

Happy to do it.
I'm coming from a MSAccess DB background and we didn't have to do this.
So it just feels strange to me.

Thanks for your patience and understanding.

Barry G. Sumpter	 









More information about the Valentina-studio mailing list