Questions inserting records with object pointers.

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Nov 3 21:30:27 CST 2003


on 11/3/03 19:48, chuck hinkle at chuckbo at hinkles.us wrote:

> I've got my schemas built (I believe), and I'm able to review them, and
> they look okay. But I haven't figured out how to deal with tables that are
> connected by object pointers.
> 
> Let's say that I have three tables:
> 
> 1) Employees
> 2) Departments
> and 3) Dept_Emp which is used to resolve the many-to-many relationship
> between employees and departments. Dept_Emp will have two fields in it,
> ptrEmployee and ptrDepartment.
> 
> Now, let's say that I want to assign some employees to teams. What will
> the SQL be for that? I was thinking that I would have to
> 1) Retrieve the RecordID for the Employee and assign it to an integer
> variable (in RB);
> 2) Retrieve the RecordID for the dept and assign it to an integer.
> 3) Write a SQL statement to do an Insert with the two pointers.

Absolutely right!
 
> But that seems to go against the idea behind the Valentina model; I feel
> like I'm trying to manipulate data that Valentina wants to manage itself.
> Am I really on the right track, or is there an easier, recommended way?

No, you think in the right way,

ObjectPtr is a kind of ULONG field, you need SELF assign ULONG value to it.
And you need obtain this ULONG value from RecID of pointed record.

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list