ObjectRefs
Ruslan Zasukhin
sunshine at public.kherson.ua
Wed Jul 13 23:08:40 CDT 2005
On 7/13/05 7:14 PM, "Andrew Sinning" <andrew at learningware.com> wrote:
Hi Andrew,
> I recently learned that I have completely misunderstood the use of the
> objectRef data type. Now I'm trying to get it straight.
>
> Suppose I want to add 5 entries to an "answers" table that correspond to
> an entry in a "questions" table. How do I do this?
You need to know "KEY" of record in questions table.
for RBDB way -- this is YOUR own ID field.
for ObjectPtr way -- this is RecID field.
Now when you know value of key, e.g. RecID = 55
You can add new records to Table Answers,
And link them to record 55 of table Questions.
* or INSERT INTO Questions (f1, Ptr) VALUES (v1, 55 )
* or API way
Table.Field(f1).value = v1
Table.Field("ptr").value = 55
Table.AddRecord()
> First, I'm going to need the RecId of the entry in the questions table,
> correct?
Aha, RIGHT!
> This has to be explicitly requested in the sql SELECT
> statement eg "SELECT RecId, * FROM questions...".
If you use SQL and cursors then YES.
> Now, to add new records to the answers table, do I just specify the
> value of the objectRef field as the integer corresponding to the RecId
> of the question?
YES :-))
--
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