New Oracle object with nested object.

Eric^2

Member²
Oracle type tperson contains a name and address properties.

Oracle type taddress contains a city property.

APerson := TOracleObject.Create(blah);
APerson.SetAttr('Name') := 'Eric'; AAddress := APerson.ObjAttr('Address');
AAddress.SetAttr('City') := 'Cleveland'; // Fails not finding City.

I think the problem is that the nested attribute is null (since it's a new object) but I don't know how to populate it. The taddress type doesn't have an associated table since it's a nested type, so I can't create a new object and assign it to the object attribute. How do I create a new nested object for a new parent object?
 
This works fine when I try it in the ObjectGrid demo (after removing the syntax errors from your example
wink.gif
):
Code:
Person := TOracleObject.Create(MainSession, 'TDemoPerson', 'DemoPersons');
Address := Person.ObjAttr('Address');
Address.SetAttr('City', 'New York');
Are you sure the City attribute exists?

------------------
Marco Kalter
Allround Automations

[This message has been edited by mkalter (edited 11 July 2002).]
 
As usual, fat fingers got me again...

I was building the object based upon two tables and an INSTEAD OF trigger. I typed 'Coty' instead of 'City' into the view.
 
Back
Top